aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-05-11 21:54:05 +0930
committerAlan Modra <amodra@gmail.com>2016-05-11 22:40:09 +0930
commit3bd43ebcb6025a8a43f119238f490e2e238697a2 (patch)
tree8f23db6516221776375d577ae78f6e3a145c69e5 /bfd/elf64-ppc.c
parenta6684f0dddb292873f962dc36b20e6db00ef6b09 (diff)
downloadgdb-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/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c2
1 files changed, 2 insertions, 0 deletions
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;