This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [x86-64-psABI] RFC: Add R_X86_64_RELAX_PC32 and R_X86_64_RELAX_PLT32
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- 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 08:52:28 -0700
- 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> <alpine dot LSU dot 2 dot 20 dot 1505111744400 dot 4883 at wotan dot suse dot de>
On Mon, May 11, 2015 at 8:48 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Mon, 11 May 2015, H.J. Lu wrote:
>
>> To remove one direct branch to PLT for external function calls:
>>
>> https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00001.html
>>
>> 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,
>> respectively.
>> 4. Optionally, linker can convert
>>
>> 0x48 call/jmp foo[@PLT]
>>
>> to
>>
>> 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.
>
I will clarify in the spec language. Yes, that is the intention for both
R_X86_64_RELAX_PC32 and R_X86_64_RELAX_PLT32. That is what
is implemented on users/hjl/relax branch.
--
H.J.