diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-01-20 14:25:24 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-01-20 14:29:36 -0800 |
commit | 8a1b824af786989f879ab1421a4279f60bba141a (patch) | |
tree | f65b22a2b06df3077fd57cb0978c81fc28d320ea /bfd | |
parent | 44301db1ac68cd26c559df225fe6d1bbc96638a0 (diff) | |
download | gdb-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')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elfxx-x86.c | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 13c2ea6..3d07aac 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2018-01-20 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/22721 + * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the + versioned __tls_get_addr symbol. + 2018-01-19 Nick Clifton <nickc@redhat.com> * po/fr.po: Updated French translation. 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. */ |