This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Question on tc_i386_fix_adjustable
On Wed, Aug 22, 2007 at 08:11:31AM +0800, Jie Zhang wrote:
> Does anyone know why the following three relocation types cannot be adjusted?
It may be OK for GOTOFF. The other two can't be adjusted to be
against their section symbols, because that would place an entry for
the section symbol in the PLT or GOT rather than a local symbol. The
problem is in the way the ABI defines the behaviour of "sym+off@got".
This places an entry in GOT for sym, and resolves to that location in
the GOT plus "off" which is totally useless as it points to some
entirely unrelated GOT entry. Similarly for @plt.
> int
> tc_i386_fix_adjustable (fixS *fixP ATTRIBUTE_UNUSED)
> {
> [snip]
> /* adjust_reloc_syms doesn't know about the GOT. */
> if (fixP->fx_r_type == BFD_RELOC_386_GOTOFF
> || fixP->fx_r_type == BFD_RELOC_386_PLT32
> || fixP->fx_r_type == BFD_RELOC_386_GOT32
> [snip])
> return 0;
> [snip]
> }
--
Alan Modra
Australia Development Lab, IBM