This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: about Reloc Type: BFD_RELOC_8/16/32


Hi Daniel,

     After adding the parameter "-g" into gcc, there are lots of data
generated from gcc, and I guess this is for debug.

Correct.


And the " .4byte	$LECIE0-$LSCIE0" code will cause the function
"emit_expr_fix" in read.c.
This is where generate the relocation type "BFD_RELOC_8/16/32", I just
don't know what those relocation is.

OK, what these relocations say is that a 8-bit, 16-bit or 32-bit value needs to be inserted at the location pointed to by the reloc. The value to be inserted is the value/address of the symbol associated with the reloc, plus whatever addend the reloc may have. The value is an absolute value, not a PC relative one.


It is not clear however why gas should be generating one of these relocs for the ".4byte $LECIE0 - $LSCIE0" expression. Normally they are only generated when one symbol is involved, not two. Usually the difference of two symbols in the same section can be computed at assembly time, so there is no need to generate a reloc to resolve the expression at link time. The exception to this is ports which perform link-time relaxation where the addresses of symbols in the same section could change because of changes in code size.

Cheers
  Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]