PATCH: PR gas/17598: R_X86_64_GOTPLT64 relocation isn't tested
H.J. Lu
hjl.tools@gmail.com
Thu Nov 13 19:30:00 GMT 2014
On Thu, Nov 13, 2014 at 11:13 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> R_X86_64_GOTPLT64 isn't necessary and R_X86_64_GOT64 should be used
> instead. I checked in this patch to add assembler support for @gotplt,
> but treat R_X86_64_GOTPLT64 the same R_X86_64_GOT64. There should be
> no impact on GCC since GCC never generates R_X86_64_GOTPLT64 and
> R_X86_64_GOT64 is optimal anyway.
>
>
> H.J.
> ---
> bfd/
>
> PR gas/17598
> * elf64-x86-64.c (elf_x86_64_check_relocs): Treat
> R_X86_64_GOTPLT64 the same as R_X86_64_GOT64.
> (elf_x86_64_relocate_section): Likewise.
>
> gas/
>
> PR gas/17598
> * config/tc-i386.c (reloc): Support BFD_RELOC_X86_64_GOTPLT64.
>
> gas/testsuite/
>
> PR gas/17598
> * gas/i386/reloc64.s: Add @gotplt check.
>
> * gas/i386/reloc64.d: Updated.
> * gas/i386/reloc64.l: Likewise.
>
> ld/testsuite/
>
> PR gas/17598
> * ld-x86-64/x86-64.exp: Run gotplt1.
>
> * ld-x86-64/gotplt1.d: New file.
> * ld-x86-64/gotplt1.s: Likewise.
I checked in this patch to mark R_X86_64_GOTPLT64 obsolete.
--
H.J.
--
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 001a940..aaee35d 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ * x86-64.h (R_X86_64_GOTPLT64): Mark it obsolete.
+
2014-10-17 Jose E. Marchesi <jose.marchesi@oracle.com>
* sparc.h (ELF_SPARC_HWCAP2_VIS3B): Documentation improved.
diff --git a/include/elf/x86-64.h b/include/elf/x86-64.h
index d0dda47..13f87b2 100644
--- a/include/elf/x86-64.h
+++ b/include/elf/x86-64.h
@@ -58,8 +58,7 @@ START_RELOC_NUMBERS (elf_x86_64_reloc_type)
offset to GOT entry */
RELOC_NUMBER (R_X86_64_GOTPC64, 29) /* 64 bit signed pc relative
offset to GOT */
- RELOC_NUMBER (R_X86_64_GOTPLT64, 30) /* like GOT64, but indicates
- that PLT entry is needed */
+ RELOC_NUMBER (R_X86_64_GOTPLT64, 30) /* Obsolete. The same
as GOT64. */
RELOC_NUMBER (R_X86_64_PLTOFF64, 31) /* 64 bit GOT relative offset
to PLT entry */
RELOC_NUMBER (R_X86_64_SIZE32, 32) /* 32-bit symbol size */
More information about the Binutils
mailing list