aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-01-20 14:25:24 -0800
committerH.J. Lu <hjl.tools@gmail.com>2018-01-20 14:29:36 -0800
commit8a1b824af786989f879ab1421a4279f60bba141a (patch)
treef65b22a2b06df3077fd57cb0978c81fc28d320ea /bfd/elfxx-x86.c
parent44301db1ac68cd26c559df225fe6d1bbc96638a0 (diff)
downloadgdb-8a1b824af786989f879ab1421a4279f60bba141a.zip
gdb-8a1b824af786989f879ab1421a4279f60bba141a.tar.gz
gdb-8a1b824af786989f879ab1421a4279f60bba141a.tar.bz2
x86: Check the versioned __tls_get_addr symbol
We need to check the versioned __tls_get_addr symbol when looking up "__tls_get_addr". bfd/ PR ld/22721 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the versioned __tls_get_addr symbol. ld/ PR ld/22721 * testsuite/ld-plugin/lto.exp: Run PR ld/22721 tests. * testsuite/ld-plugin/pr22721.t: New file. * testsuite/ld-plugin/pr22721a.s: Likewise. * testsuite/ld-plugin/pr22721b.c: Likewise.
Diffstat (limited to 'bfd/elfxx-x86.c')
-rw-r--r--bfd/elfxx-x86.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index a9ee4ba..a7db5d9 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -856,7 +856,16 @@ _bfd_x86_elf_link_check_relocs (bfd *abfd, struct bfd_link_info *info)
htab->tls_get_addr,
FALSE, FALSE, FALSE);
if (h != NULL)
- elf_x86_hash_entry (h)->tls_get_addr = 1;
+ {
+ elf_x86_hash_entry (h)->tls_get_addr = 1;
+
+ /* Check the versioned __tls_get_addr symbol. */
+ while (h->root.type == bfd_link_hash_indirect)
+ {
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ elf_x86_hash_entry (h)->tls_get_addr = 1;
+ }
+ }
/* "__ehdr_start" will be defined by linker as a hidden symbol
later if it is referenced and not defined. */