aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-03 10:18:24 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-03 10:18:38 -0700
commit0e30d991804de9dfd368653d6a88bf3766a27ffc (patch)
tree8f5eeb01864a642450114e269c4e95b85d9f3d53 /bfd
parent1cf58434bf9d90ea0669f97514c63dc1ccf38f7c (diff)
downloadgdb-0e30d991804de9dfd368653d6a88bf3766a27ffc.zip
gdb-0e30d991804de9dfd368653d6a88bf3766a27ffc.tar.gz
gdb-0e30d991804de9dfd368653d6a88bf3766a27ffc.tar.bz2
x86-64: Set tlsdesc_plt if GOT_TLS_GDESC_P is true
We need to set tlsdesc_plt for x86-64 if GOT_TLS_GDESC_P is true when allocating dynamic relocations so that _bfd_x86_elf_size_dynamic_sections will generate TLSDESC_PLT and TLSDESC_GOT in x86-64 output. bfd/ PR ld/22071 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt for x86-64 if GOT_TLS_GDESC_P is true. ld/ PR ld/22071 * testsuite/ld-x86-64/pr22071.d: New file. * testsuite/ld-x86-64/pr22071.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr22071.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfxx-x86.c6
2 files changed, 11 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 958b89d..3b3a53c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22071
+ * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
+ for x86-64 if GOT_TLS_GDESC_P is true.
+
2017-09-03 Alan Modra <amodra@gmail.com>
PR 22067
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index cac451d..a7e9eda 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -368,7 +368,11 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h,
|| WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
htab->elf.srelgot->size += htab->sizeof_reloc;
if (GOT_TLS_GDESC_P (tls_type))
- htab->elf.srelplt->size += htab->sizeof_reloc;
+ {
+ htab->elf.srelplt->size += htab->sizeof_reloc;
+ if (bed->target_id == X86_64_ELF_DATA)
+ htab->tlsdesc_plt = (bfd_vma) -1;
+ }
}
else
h->got.offset = (bfd_vma) -1;