Replace DT_PPC_TLSOPT with DT_PPC_OPT.
authorAlan Modra <amodra@gmail.com>
Tue, 29 Oct 2013 06:04:35 +0000 (16:34 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 30 Oct 2013 03:13:32 +0000 (13:43 +1030)
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.

bfd/ChangeLog
bfd/elf32-ppc.c
bfd/elf64-ppc.c
binutils/ChangeLog
binutils/readelf.c
include/elf/ChangeLog
include/elf/ppc.h
include/elf/ppc64.h

index 6afd755a283ada655b1bab4fa1871ec941f31c74..ae0a0243281e2fbed9155b7537c268cc93317e74 100644 (file)
@@ -1,3 +1,11 @@
+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.
index d6aae81d8e3e402d95cf8311d8220525caf63544..63928dc099a5079e0d0575afcaa1ff1ff3db6c1c 100644 (file)
@@ -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;
        }
 
index 8f74333fbe3182d2f7ec3dcb9e7f03e2c07af0b1..6a8ec513468814f83616f3abd581dd27ef238a3f 100644 (file)
@@ -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)
index 9774deadb3a2413a5cd5db337b27ec66e70af4f7..457f0b01c7babfcf7d9e732ec2ce5b3265e4a11f 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-30  Alan Modra  <amodra@gmail.com>
+
+       * readelf.c (get_ppc_dynamic_type): Replace PPC_TLSOPT with PPC_OPT.
+       (get_ppc64_dynamic_type): Replace PPC64_TLSOPT with PPC64_OPT.
+
 2013-10-30  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * readelf.c (get_ppc64_symbol_other): New function.
index c99b46e536ae77186063e2ebc7741dbb07cd35ec..0389f147c127b449db29a2a48bf718becd289a47 100644 (file)
@@ -1575,7 +1575,7 @@ get_ppc_dynamic_type (unsigned long type)
   switch (type)
     {
     case DT_PPC_GOT:    return "PPC_GOT";
-    case DT_PPC_TLSOPT: return "PPC_TLSOPT";
+    case DT_PPC_OPT:    return "PPC_OPT";
     default:
       return NULL;
     }
@@ -1589,7 +1589,7 @@ get_ppc64_dynamic_type (unsigned long type)
     case DT_PPC64_GLINK:  return "PPC64_GLINK";
     case DT_PPC64_OPD:    return "PPC64_OPD";
     case DT_PPC64_OPDSZ:  return "PPC64_OPDSZ";
-    case DT_PPC64_TLSOPT: return "PPC64_TLSOPT";
+    case DT_PPC64_OPT:    return "PPC64_OPT";
     default:
       return NULL;
     }
index 7e98ddbf3c25cedc64c90787019ec329c8fab1ed..68b100210444f64f191e7062be2f4387ec7e99f2 100644 (file)
@@ -1,3 +1,10 @@
+2013-10-30  Alan Modra  <amodra@gmail.com>
+
+       * 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.
+
 2013-10-30  Alan Modra  <amodra@gmail.com>
 
        * ppc64.h (STO_PPC64_LOCAL_BIT, STO_PPC64_LOCAL_MASK): Define.
index f80a1e8a3e9c5852902beaafbb6a2a9e36d815c3..da00df8688d5f288bf8b66a2eca451e2b855aae9 100644 (file)
@@ -176,7 +176,8 @@ END_RELOC_NUMBERS (R_PPC_max)
 #define DT_PPC_GOT             (DT_LOPROC)
 
 /* Specify that tls descriptors should be optimized.  */
-#define DT_PPC_TLSOPT          (DT_LOPROC + 1)
+#define DT_PPC_OPT             (DT_LOPROC + 1)
+#define PPC_OPT_TLS            1
 
 /* Processor specific flags for the ELF header e_flags field.  */
 
index d3cfdfb82cee32d0943cb91ce8597be1ca59e6e6..78d947baea90fd1b40c9b708dbd2c39278557481 100644 (file)
@@ -234,7 +234,9 @@ ppc64_encode_local_entry(unsigned int val)
 #define DT_PPC64_OPD           (DT_LOPROC + 1)
 #define DT_PPC64_OPDSZ         (DT_LOPROC + 2)
 
-/* Specify that tls descriptors should be optimized.  */
-#define DT_PPC64_TLSOPT                (DT_LOPROC + 3)
+/* Specify whether various optimisations are possible.  */
+#define DT_PPC64_OPT           (DT_LOPROC + 3)
+#define PPC64_OPT_TLS          1
+#define PPC64_OPT_MULTI_TOC    2
 
 #endif /* _ELF_PPC64_H */
This page took 0.045101 seconds and 4 git commands to generate.