This is the mail archive of the
mailing list for the GCC project.
[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: "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 07:59:52 -0700
- Subject: [x86-64-psABI] RFC: Add R_X86_64_RELAX_PC32 and R_X86_64_RELAX_PLT32
- Authentication-results: sourceware.org; auth=none
To remove one direct branch to PLT for external function calls:
I am proposing to add 2 new relocations, R_X86_64_RELAX_PC32
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]
when function foo is undefined.
R_X86_64_RELAX_PC32 is defined as 39, which was the
deprecated R_X86_64_PC32_BND for
bnd call/jmp foo
R_X86_64_RELAX_PLT32 is defined as 40, which was the
deprecated R_X86_64_PLT32_BND for
bnd call/jmp foo@PLT
Since the current linkers treat R_X86_64_PC32_BND and
R_X86_64_PLT32_BND as _X86_64_PC32 and R_X86_64_PLT32,
respectively, they can handle the new ones correctly.