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: Why are there 2 continous R_MIPS_HI16 reloc entries in the ELF excutable?


Ian Lance Taylor <iant@google.com> writes:
> "Pan ruochen" <panruochen@gmail.com> writes:
>
>>> The GNU toolchain allows relaxed rules of R_MIPS_HI16/R_MIPS_LO16
>>> as an extension. (This allows some optimizations which wouldn't be
>>> possible otherwise.)
>>>
>>>
>>> Thiemo
>>>
>>
>> How should I handle the GNU extension then? Are there any document?
>
> Compute R_MIPS_HI16 as usual.  For R_MIPS_LO16, use the addend from
> the immediately preceding R_MIPS_HI16.

Probably stating the obvious, sorry, but just in case there's any
confusion: the names of the relocs are swapped here.

Compute R_MIPS_LO16 as usual.  For R_MIPS_HI16, use the addend from the
next R_MIPS_LO16 (skipping over any intervening non-R_MIPS_LO16 relocs).

Richard


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