diff options
author | Alan Modra <amodra@gmail.com> | 2016-05-11 21:54:05 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2016-05-11 22:40:09 +0930 |
commit | 3bd43ebcb6025a8a43f119238f490e2e238697a2 (patch) | |
tree | 8f23db6516221776375d577ae78f6e3a145c69e5 /bfd | |
parent | a6684f0dddb292873f962dc36b20e6db00ef6b09 (diff) | |
download | gdb-3bd43ebcb6025a8a43f119238f490e2e238697a2.zip gdb-3bd43ebcb6025a8a43f119238f490e2e238697a2.tar.gz gdb-3bd43ebcb6025a8a43f119238f490e2e238697a2.tar.bz2 |
ld --gc-sections fail with __tls_get_addr_opt
When --gc-sections is active, __tls_get_addr_opt is marked as not
needed and forced local before ppc*_elf_tls_setup is run.
bfd/
PR 20060
* elf64-ppc.c (ppc64_elf_tls_setup): Clear forced_local.
* elf32-ppc.c (ppc_elf_tls_setup): Likewise.
ld/
PR 20060
* testsuite/ld-powerpc/powerpc.exp: Run new tests.
* testsuite/ld-powerpc/tlsdll.s: New.
* testsuite/ld-powerpc/tlsdll.ver: New.
* testsuite/ld-powerpc/tlsdll_32.s: New.
* testsuite/ld-powerpc/tlsopt5.d: New.
* testsuite/ld-powerpc/tlsopt5.s: New.
* testsuite/ld-powerpc/tlsopt5_32.d: New.
* testsuite/ld-powerpc/tlsopt5_32.s: New.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 1 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f2b9f6e..595d724 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2016-05-11 Alan Modra <amodra@gmail.com> + + PR 20060 + * elf64-ppc.c (ppc64_elf_tls_setup): Clear forced_local. + * elf32-ppc.c (ppc_elf_tls_setup): Likewise. + 2016-05-10 Jiong Wang <jiong.wang@arm.com> * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Remove redundant diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 369a5e6..f3e5e42 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -5164,6 +5164,7 @@ ppc_elf_tls_setup (bfd *obfd, struct bfd_link_info *info) tga->root.type = bfd_link_hash_indirect; tga->root.u.i.link = &opt->root; ppc_elf_copy_indirect_symbol (info, opt, tga); + opt->forced_local = 0; if (opt->dynindx != -1) { /* Use __tls_get_addr_opt in dynamic relocations. */ diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 3717160..d15f50b 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -8226,6 +8226,7 @@ ppc64_elf_tls_setup (struct bfd_link_info *info) tga_fd->root.type = bfd_link_hash_indirect; tga_fd->root.u.i.link = &opt_fd->root; ppc64_elf_copy_indirect_symbol (info, opt_fd, tga_fd); + opt_fd->forced_local = 0; if (opt_fd->dynindx != -1) { /* Use __tls_get_addr_opt in dynamic relocations. */ @@ -8242,6 +8243,7 @@ ppc64_elf_tls_setup (struct bfd_link_info *info) tga->root.type = bfd_link_hash_indirect; tga->root.u.i.link = &opt->root; ppc64_elf_copy_indirect_symbol (info, opt, tga); + opt->forced_local = 0; _bfd_elf_link_hash_hide_symbol (info, opt, tga->forced_local); htab->tls_get_addr = (struct ppc_link_hash_entry *) opt; |