QUERY in relocation of ABSOLUTE SYMBOLS
Nick Clifton
nickc@redhat.com
Sun Jul 23 14:29:00 GMT 2006
Hi Santosh,
> I have a query in relocation for HI AND LO operators.
You should mention which architecture(s) you are concerned about as this
may be important.
> Assume that we know the address of ABSOLUTESYMBOL while assembling.
> Addiu r3, HI ( ABSOLUTE SYMBOL )
> ORI r2, LO ( ABSOLUTE SYMBOL )
>
> Its it better to emit relocation information for the above HI AND LO or
> to resolve in assembling itself
If the ABI for the architecture says that you must emit the relocs for
this situation then you must do it. Otherwise it is better not to emit
the relocs but resolve the expression in the assembler. This simplifies
the generated object file which means that it will be that little bit
faster to link.
Note - if the address for ABSOLUTESYMBOL is only for a weak definition
then you must also emit the relocs. The weak definition might be
overridden by another definition in another object file.
Cheers
Nick
More information about the Binutils
mailing list