]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add DT_PPC64_OPD and DT_PPC64_OPDSZ dynamic tags.
authorAlan Modra <amodra@gmail.com>
Tue, 12 Feb 2002 06:45:43 +0000 (06:45 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 12 Feb 2002 06:45:43 +0000 (06:45 +0000)
* elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing
64k boundary.

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

index aa8c6147d428aa0aa397c6355ba462b178de214f..484d64ec18e0da657494206143c5740a31c96545 100644 (file)
@@ -1,3 +1,12 @@
+2002-02-12  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing
+       64k boundary.
+
+       * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic
+       DT_PPC64_OPD and DT_PPC64_OPDSZ tags.
+       (ppc64_elf_finish_dynamic_sections): Set values for them.
+
 2002-02-11  Alexandre Oliva  <aoliva@redhat.com>
 
        * elf32-sh.c: Added missing prototypes.
 
 2002-01-31  Philipp Thomas  <pthomas@suse.de>
 
-        * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR
-        to front of message. Unify messages with elf32-arm.h. Use
-        commas where neccessary.
-        * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase
-        ERROR in messages. Unify messages with coff-arm.c. Correct
-        VFP/FPA error message.
-        (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and
-        APCS-32 for translation.
+       * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR
+       to front of message. Unify messages with elf32-arm.h. Use
+       commas where neccessary.
+       * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase
+       ERROR in messages. Unify messages with coff-arm.c. Correct
+       VFP/FPA error message.
+       (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and
+       APCS-32 for translation.
 
 2002-02-01  Hans-Peter Nilsson  <hp@bitrange.com>
 
index a945f5ca431dee81cbc621d9e3b0ed506f61a74c..cca9b7f2bda6db3a58c2476c1a8ec869096ce569 100644 (file)
@@ -156,11 +156,8 @@ static boolean ppc64_elf_finish_dynamic_sections
 /* Since .opd is an array of descriptors and each entry will end up
    with identical R_PPC64_RELATIVE relocs, there is really no need to
    propagate .opd relocs;  The dynamic linker should be taught to
-   relocate .opd without reloc entries.  FIXME: the dynamic linker
-   will need to know where and how large .opd is via a couple of new
-   DT_PPC64_* tags, or perhaps just with one reloc that specifies the
-   start of .opd via its offset and the size via its addend.  Also,
-   .opd should be trimmed of unused values.  */
+   relocate .opd without reloc entries.  FIXME: .opd should be trimmed
+   of unused values.  */
 #ifndef NO_OPD_RELOCS
 #define NO_OPD_RELOCS 0
 #endif
@@ -3128,6 +3125,13 @@ ppc64_elf_size_dynamic_sections (output_bfd, info)
            return false;
        }
 
+      if (NO_OPD_RELOCS)
+       {
+         if (!add_dynamic_entry (DT_PPC64_OPD, 0)
+             || !add_dynamic_entry (DT_PPC64_OPDSZ, 0))
+           return false;
+       }
+
       if (relocs)
        {
          if (!add_dynamic_entry (DT_RELA, 0)
@@ -3251,7 +3255,7 @@ ppc64_elf_size_stubs (obfd, info, changed)
 
   /* If the .plt doesn't have any entries crossing a 64k boundary,
      then there is no need for bigger stubs.  */
-  if (next_64k <= plt_offset + htab->splt->_raw_size)
+  if (plt_offset + htab->splt->_raw_size <= next_64k)
     return true;
 
   /* OK, so we have at least one transition.  Since .plt entries are
@@ -4354,6 +4358,7 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info)
       for (; dyncon < dynconend; dyncon++)
        {
          Elf_Internal_Dyn dyn;
+         asection *s;
 
          bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn);
 
@@ -4367,6 +4372,18 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info)
                                + htab->sglink->output_offset);
              break;
 
+           case DT_PPC64_OPD:
+             s = bfd_get_section_by_name (output_bfd, ".opd");
+             if (s != NULL)
+               dyn.d_un.d_ptr = s->vma;
+             break;
+
+           case DT_PPC64_OPDSZ:
+             s = bfd_get_section_by_name (output_bfd, ".opd");
+             if (s != NULL)
+               dyn.d_un.d_val = s->_raw_size;
+             break;
+
            case DT_PLTGOT:
              dyn.d_un.d_ptr = (htab->splt->output_section->vma
                                + htab->splt->output_offset);
index 76a584e158074d79f7367eb15a1aa7d662ad841a..d81862a346e346971812b2b28917e9324d06c883 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-12  Alan Modra  <amodra@bigpond.net.au>
+
+       * readelf.c (get_ppc64_dynamic_type): Handle DT_PPC64_OPD and
+       DT_PPC64_OPDSZ.
+
 2002-02-11  Daniel Jacobowitz  <drow@mvista.com>
 
        * MAINTAINERS: List myself as branch maintainer.
index e80a69d728e2359a4d0750014813eecb98e452b6..0c95f05d88444abb2664e110dbce8d4332897aed 100644 (file)
@@ -1193,6 +1193,8 @@ get_ppc64_dynamic_type (type)
   switch (type)
     {
     case DT_PPC64_GLINK: return "PPC64_GLINK";
+    case DT_PPC64_OPD:   return "PPC64_OPD";
+    case DT_PPC64_OPDSZ: return "PPC64_OPDSZ";
     default:
       return NULL;
     }
index 79f99ac64e9c65fe98a2f267be3bc5c0b68304ff..f0e04db5dea0d44340f3abaef7292ac862200b95 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-12  Alan Modra  <amodra@bigpond.net.au>
+
+       * ppc.h (DT_PPC64_OPD, DT_PPC64_OPDSZ): Define.
+
 2002-02-09  Richard Henderson  <rth@redhat.com>
 
        * alpha.h (R_ALPHA_BRSGP): New.
index 8e4af62fb1ef582a91b8fe67602461d9d044bee8..dfb43f46a403e72e3ab735909c5578cdf075eeed 100644 (file)
@@ -174,6 +174,10 @@ END_RELOC_NUMBERS (R_PPC_max)
 /* Specify the start of the .glink section.  */
 #define DT_PPC64_GLINK         DT_LOPROC
 
+/* Specify the start and size of the .opd section.  */
+#define DT_PPC64_OPD           (DT_LOPROC + 1)
+#define DT_PPC64_OPDSZ         (DT_LOPROC + 2)
+
 /* Processor specific flags for the ELF header e_flags field.  */
 
 #define        EF_PPC_EMB              0x80000000      /* PowerPC embedded flag.  */