"Boyapati, Anitha" <anitha.boyap...@atmel.com> wrote:

> I am trying to understand relocation types in AVR. To start with,
> can someone illustrate how R_AVR_16 works in the following case?

I can only guess.  Don't know whether there's someone with more
insight.

> As I see it, since the address is 16-bit, 'size' is 1. How do we arrive
> at 'rightshift' and 'bitsize' entries?

No idea what rightshift is doing, you might get an idea by comparing
against other relocation types.

bitsize should be clear: it's a 16-bit relocation.  My guess is that
bitsize might be different for other relocations even with the same
'size' field; compare that e.g. to the relative branch and jump
relocations (R_AVR_7_PCREL and R_AVR_13_PCREL).

> And how assembler knows to emit
> R_AVR_16 type?

Probably from the instruction it is connected with.  Obviously,
R_AVR_16 only applies to instructions like STS/LDS etc.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to