This is the mail archive of the
mailing list for the binutils project.
Re: What is R_X86_64_GOTPLT64 used for?
- From: Richard Henderson <rth at twiddle dot net>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, "x86-64-abi at googlegroups dot com" <x86-64-abi at googlegroups dot com>, GCC Development <gcc at gcc dot gnu dot org>, Binutils <binutils at sourceware dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 13 Nov 2014 17:19:11 +0100
- Subject: Re: What is R_X86_64_GOTPLT64 used for?
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOqb0g2asAe6UZ0hxh8jFf-+eBiaez0pLrPjd0oqVdP0Rg at mail dot gmail dot com>
On 11/13/2014 03:55 PM, H.J. Lu wrote:
> x86-64 psABI has
> name@GOT: specifies the offset to the GOT entry for the symbol name
> from the base of the GOT.
> name@GOTPLT: specifies the offset to the GOT entry for the symbol name
> from the base of the GOT, implying that there is a corresponding PLT entry.
> But GCC never generates name@GOTPLT and assembler fails to assemble
> [hjl@gnu-6 pr17598]$ cat x.S
> movabs $foo@GOTPLT,%rax
> [hjl@gnu-6 pr17598]$ gcc -c x.S
> x.S: Assembler messages:
> x.S:1: Error: relocated field and relocation type differ in signedness
Presumably that's a bug, since it does work with .quad.
> Does anyone remember what it was supposed to be used for?
Presumably some sort of non-C language where you need a non-local function
pointer, but it need not be canonical, and thus could be lazily bound.
But I don't know exactly when that would be.