aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-11-13 11:07:31 -0800
committerH.J. Lu <hjl.tools@gmail.com>2014-11-13 11:09:40 -0800
commit553d1284b7820ebc88a2e9500d813441c642bdc9 (patch)
tree18b80b0c803e11ae159d05b588c2bef38cde6b34 /bfd
parent5784b3caf8e2d55339994067e7f05dd047109b87 (diff)
downloadgdb-553d1284b7820ebc88a2e9500d813441c642bdc9.zip
gdb-553d1284b7820ebc88a2e9500d813441c642bdc9.tar.gz
gdb-553d1284b7820ebc88a2e9500d813441c642bdc9.tar.bz2
Add assembler support for @gotplt
Obsolete R_X86_64_GOTPLT64 and treat it the same as R_X86_64_GOT64. 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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf64-x86-64.c17
2 files changed, 8 insertions, 16 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 701540e..3cf91d1 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ 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.
+
2014-11-13 Nick Clifton <nickc@redhat.com>
PR binutils/17512
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index d0ed8a7..f2b13e7 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1752,14 +1752,6 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (h != NULL)
{
- if (r_type == R_X86_64_GOTPLT64)
- {
- /* This relocation indicates that we also need
- a PLT entry, as this is a function. We don't need
- a PLT entry for local symbols. */
- h->needs_plt = 1;
- h->plt.refcount += 1;
- }
h->got.refcount += 1;
old_tls_type = elf_x86_64_hash_entry (h)->tls_type;
}
@@ -2181,8 +2173,6 @@ elf_x86_64_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
case R_X86_64_GOTPLT64:
if (h != NULL)
{
- if (r_type == R_X86_64_GOTPLT64 && h->plt.refcount > 0)
- h->plt.refcount -= 1;
if (h->got.refcount > 0)
h->got.refcount -= 1;
if (h->type == STT_GNU_IFUNC)
@@ -3720,12 +3710,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
case R_X86_64_GOTPCREL64:
/* Use global offset table entry as symbol value. */
case R_X86_64_GOTPLT64:
- /* This is the same as GOT64 for relocation purposes, but
- indicates the existence of a PLT entry. The difficulty is,
- that we must calculate the GOT slot offset from the PLT
- offset, if this symbol got a PLT entry (it was global).
- Additionally if it's computed from the PLT entry, then that
- GOT offset is relative to .got.plt, not to .got. */
+ /* This is obsolete and treated the the same as GOT64. */
base_got = htab->elf.sgot;
if (htab->elf.sgot == NULL)