avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Assembler using .data+offset in some cases


From: Matthias Gauger
Subject: [avr-gcc-list] Assembler using .data+offset in some cases
Date: Thu, 27 Jan 2005 22:18:45 +0100

Hello!

I posted a similar question several days ago to avrfreaks.net.
Unfortunately, so far nobody has been able to help me. I hope that I
am not spamming too many people a second time with this email...

I am compiling code for the ATMega128 with the avr-gcc. Since I am
planning to do some link patching "by hand", I am very interested in
the output of avr-objdump.
When I looked at the relocation records of some of the object files
the compiler produced, I found a couple of relocations I don't
understand:
In some object relocations, instead of referencing a symbol from the
symbol table, the assembler creates a relocation relative to the
initialized datasection '.data'. For example:

lds r24,test

creates a relocation record looking like this:

0x0000012a R_AVR_16             .data+0x00000003

instead of

0x0000012a R_AVR_16             test


The C-Code belonging to the example command looks like this:

bool test = TRUE;
[...]
if (!test) {
  [...]
}


The generated assembler code shows the following information about 'test':

.global   test
   .data
   .type   test, @object
   .size   test, 1
test:
   .byte   1
   .text 


This only happens for a very small portion of the relocations.
I am using avr-gcc 3.3 and avr-objdump 2.13.2.1, but I could also
reproduce this with avr-gcc 3.4.1 and avr-objdump 2.15.

Can anyone tell me why the assembler does this and in which cases this
happens? Is there any way to force the assembler to reference the
symbol instead of .data? Any hint is appreciated!

Thanks a lot!


Matthias


reply via email to

[Prev in Thread] Current Thread [Next in Thread]