aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-10-29 16:34:35 +1030
committerAlan Modra <amodra@gmail.com>2013-10-30 13:43:32 +1030
commite8910a83af41c3dbfd00191b2720d4094f8d9532 (patch)
tree2d8dd9e11eece62255af6ffe3a70244b0cf91615 /bfd
parenta078d95abc554b6c2572fcab5550591639b1c871 (diff)
downloadgdb-e8910a83af41c3dbfd00191b2720d4094f8d9532.zip
gdb-e8910a83af41c3dbfd00191b2720d4094f8d9532.tar.gz
gdb-e8910a83af41c3dbfd00191b2720d4094f8d9532.tar.bz2
Replace DT_PPC_TLSOPT with DT_PPC_OPT.
This removes the DT_PPC_TLSOPT/DT_PPC64_TLSOPT dynamic tag and replaces it with DT_PPC_OPT/DT_PPC64_OPT tag to provide the same functionality and more. This isn't backwards compatible, but the TLSOPT tag hasn't been used since the tls optimisation support was never submitted to glibc. /include/elf/ * ppc.h (DT_PPC_TLSOPT): Delete. (DT_PPC_OPT, PPC_OPT_TLS): Define. * ppc64.h (DT_PPC64_TLSOPT): Delete. (DT_PPC64_OPT, PPC64_OPT_TLS, PPC64_OPT_MULTI_TOC): Define. bfd/ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Use new DT_PPC_OPT tag to specify tls optimisation. * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise. (ppc64_elf_finish_dynamic_sections): Specify whether multiple toc pointers are used via DT_PPC64_OPT. binutils/ * readelf.c (get_ppc_dynamic_type): Replace PPC_TLSOPT with PPC_OPT. (get_ppc64_dynamic_type): Replace PPC64_TLSOPT with PPC64_OPT.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elf32-ppc.c2
-rw-r--r--bfd/elf64-ppc.c20
3 files changed, 24 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6afd755..ae0a024 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,13 @@
2013-10-30 Alan Modra <amodra@gmail.com>
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Use new DT_PPC_OPT
+ tag to specify tls optimisation.
+ * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise.
+ (ppc64_elf_finish_dynamic_sections): Specify whether multiple
+ toc pointers are used via DT_PPC64_OPT.
+
+2013-10-30 Alan Modra <amodra@gmail.com>
+
* elf64-ppc.c (STK_LR, STK_TOC, STK_LINKER): Define.
(savegpr0_tail, restgpr0_tail, savefpr0_tail, restfpr0_tail)
build_plt_stub, build_tls_get_addr_stub, ppc_build_one_stub,
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index d6aae81..63928dc 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -6488,7 +6488,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (!htab->no_tls_get_addr_opt
&& htab->tls_get_addr != NULL
&& htab->tls_get_addr->plt.plist != NULL
- && !add_dynamic_entry (DT_PPC_TLSOPT, 0))
+ && !add_dynamic_entry (DT_PPC_OPT, PPC_OPT_TLS))
return FALSE;
}
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 8f74333..6a8ec51 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -9790,6 +9790,8 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd,
if (htab->elf.dynamic_sections_created)
{
+ bfd_boolean tls_opt;
+
/* Add some entries to the .dynamic section. We fill in the
values later, in ppc64_elf_finish_dynamic_sections, but we
must add the entries now so that we get the correct size for
@@ -9821,11 +9823,14 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd,
return FALSE;
}
- if (!htab->no_tls_get_addr_opt
- && htab->tls_get_addr_fd != NULL
- && htab->tls_get_addr_fd->elf.plt.plist != NULL
- && !add_dynamic_entry (DT_PPC64_TLSOPT, 0))
- return FALSE;
+ tls_opt = (!htab->no_tls_get_addr_opt
+ && htab->tls_get_addr_fd != NULL
+ && htab->tls_get_addr_fd->elf.plt.plist != NULL);
+ if (tls_opt || !htab->opd_abi)
+ {
+ if (!add_dynamic_entry (DT_PPC64_OPT, tls_opt ? PPC64_OPT_TLS : 0))
+ return FALSE;
+ }
if (relocs)
{
@@ -14659,6 +14664,11 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
dyn.d_un.d_ptr = s->vma;
break;
+ case DT_PPC64_OPT:
+ if (htab->do_multi_toc && htab->multi_toc_needed)
+ dyn.d_un.d_val |= PPC64_OPT_MULTI_TOC;
+ break;
+
case DT_PPC64_OPDSZ:
s = bfd_get_section_by_name (output_bfd, ".opd");
if (s == NULL)