[committed, PATCH] PR gas/19600: Preserve addend for R_386_GOT32 and R_X86_64_GOT32

Alan Modra amodra@gmail.com
Sun May 22 05:19:00 GMT 2016


On Fri, May 20, 2016 at 06:02:43AM -0700, H.J. Lu wrote:
> We should preserve addend for R_386_GOT32 and R_X86_64_GOT32 as in
> "movl $foo@GOT + 4, %eax" and "movq $foo@GOT + 4, %rax".

Well, perhaps, but it is mostly useless.  Consider that $foo@got
results in an entry in the GOT containing the value of foo, and
resolves to that entry's address.  On x86 $foo@got+4 gives you the
next entry in the GOT, which is for some random other symbol (or
perhaps even off the end of the GOT).

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list