Writing addend into instructions

Torbjorn Granlund tege@swox.com
Tue Mar 13 13:34:00 GMT 2001


Andrew Haley <aph@redhat.com> writes:

   > Hmm.  A toolchain that bases a relocation on such a value surely will
   > not work.  Consider a typical RISC sethi/oris/ldah type instruction.
   > If you put an addend that is smaller than a full address into its
   > (say) 16-bit field, and then let that take part of a relocation, you
   > lose carry.
  
  Certainly, but the relocation might be to somwhere known to be on the
  same page, in which case there needn't be any high part.  I'm not
  saying that it's common, but there might be uses for it.
  
You probably mean "needn't be any low part".

Could you please give me an example, preferably for ELF/PowerPC, where
something depends on that the addend is written into the relocation
field?

-- 
Torbjörn



More information about the Binutils mailing list