This is the mail archive of the
mailing list for the GCC project.
Re: [x86-64-psABI] RFC: Add R_X86_64_RELAX_PC32 and R_X86_64_RELAX_PLT32
- From: Michael Matz <matz at suse dot de>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "x86-64-abi at googlegroups dot com" <x86-64-abi at googlegroups dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 11 May 2015 17:48:21 +0200 (CEST)
- Subject: Re: [x86-64-psABI] RFC: Add R_X86_64_RELAX_PC32 and R_X86_64_RELAX_PLT32
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOp9tv1bnUPJ6s=NR7=5srs48Vqn5-L0Te9agSNSUTyrkw at mail dot gmail dot com>
On Mon, 11 May 2015, H.J. Lu wrote:
> To remove one direct branch to PLT for external function calls:
> I am proposing to add 2 new relocations, R_X86_64_RELAX_PC32
> and R_X86_64_RELAX_PLT32:
> 1. They can only be used on 32-bit PC relative call/jmp instructions.
> 2. call/jmp instructions must have a 0x48 prefix.
> 3. Linker can treat them as R_X86_64_PC32 and R_X86_64_PLT32,
> 4. Optionally, linker can convert
> 0x48 call/jmp foo[@PLT]
> call/jmp *foo@GOTPCREL(%rip)
Perhaps it should be clarified that the intention here is, that the
respective GOT slot will be relocated with the PLT slot address+6, not
with the final address of symbol foo (that will be done when actually
jumping/calling through that got slot); at least when RELAX_PLT32 is used.