This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [x86-64-psABI] RFC: Add R_X86_64_RELAX_PC32 and R_X86_64_RELAX_PLT32


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]