Help about calculation of addend for ELF relocations for MIPS arch
Ian Lance Taylor
iant@google.com
Tue Aug 12 14:08:00 GMT 2008
"Pan ruochen" <panruochen@gmail.com> writes:
> Does this mean the addend is saved in the storage location where relocation
> will be applied to ? For example, for a R_MIPS_26 relocation entry, the addend
> is saved in the `targ26' field.
Yes.
> Let's deduce back from the final results. The relocation entry is at
> the offset 0x18,
> and of the type `R_MIPS_26'. The symbol is not local, so the foluma
> (sign-extend(A<<2) + S) >> 2
> should be applied. And S will be the value of the symbol `entry',
> which is 0x2e8.
No. In the reloc computation, S is the value of the symbol in the
fully linked executable, not the value in the object file. In this
case I imagine that S is 0x188e12e8.
Ian
More information about the Binutils
mailing list