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: QUERY in relocation of ABSOLUTE SYMBOLS


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



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