* elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Merge dyn_reloc
authorAlan Modra <amodra@gmail.com>
Mon, 15 Oct 2001 07:28:45 +0000 (07:28 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 15 Oct 2001 07:28:45 +0000 (07:28 +0000)
counts for aliases instead of aborting.
* elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.

* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set plt.offset
to -1 for non-function symbols.
* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
* elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
* elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
* elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise.
* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Refer to
plt.offset instead of plt.refcount when setting to -1.

bfd/ChangeLog
bfd/elf32-hppa.c
bfd/elf32-i386.c
bfd/elf32-ppc.c
bfd/elf32-s390.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elf64-x86-64.c

index 5abf7aba3297ffedf7b4142ee77fbbb8492b9153..cd8dfa7264cc0fc138bdb9b4f5880c8242f5e0f6 100644 (file)
@@ -1,3 +1,21 @@
+2001-10-15  Alan Modra  <amodra@bigpond.net.au>
+           H.J. Lu  <hjl@gnu.org>
+
+       * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Merge dyn_reloc
+       counts for aliases instead of aborting.
+       * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
+       * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
+
+       * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set plt.offset
+       to -1 for non-function symbols.
+       * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
+       * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
+       * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
+       * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
+       * elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise.
+       * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Refer to
+       plt.offset instead of plt.refcount when setting to -1.
+
 2001-10-12  Nick Clifton  <nickc@cambridge.redhat.com>
 
        * elf32-arm.h (elf32_arm_relocate_section): Treat R_ARM_THM_PC22
 
 2001-10-08  Aldy Hernandez  <aldyh@redhat.com>
 
-        * bfd/config.bfd (targ_cpu): Add arm9e-*-elf.
+       * bfd/config.bfd (targ_cpu): Add arm9e-*-elf.
 
 2001-10-06  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
 
        * elf-bfd.h (struct elf_link_hash_entry): Reorganise for better
        packing.
 
-       * elf32-mips.c (mips_elf_record_global_got_symbol): Set got.offset 
+       * elf32-mips.c (mips_elf_record_global_got_symbol): Set got.offset
        to 1 rather than 0 to avoid confusing copy_indirect_symbol.
        (mips_elf_sort_hash_table_f): Compare got.offset against 1.
 
        * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
        (elfNN_ia64_aix_add_symbol_hook): Use elf_link_hash_lookup rather
        than bfd_link_hash_lookup.
-       * elf32-i386 (elf_i386_adjust_dynamic_symbol): Don't do copy
+       * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't do copy
        reloc processing for weakdefs.
        * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
        * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
        * libcoff.h: Likewise.
 
 2001-09-30  kaz Kojima  <kkojima@rr.iij4u.or.jp>
-            Hans-Peter Nilsson  <hp@bitrange.com>
+           Hans-Peter Nilsson  <hp@bitrange.com>
 
        * elf32-sh.c (sh_elf_howto_table, R_SH_REL32): Make
        partial_inplace, matching assembler output.  Set src_mask to
index 557b9fe4ca90a3a96b0383e635c1e363d64d16db..65315753b250b96fdd4b383b30fc84eecd2fb708 100644 (file)
@@ -1142,13 +1142,41 @@ elf32_hppa_copy_indirect_symbol (dir, ind)
   edir = (struct elf32_hppa_link_hash_entry *) dir;
   eind = (struct elf32_hppa_link_hash_entry *) ind;
 
-  if (edir->dyn_relocs == NULL)
+  if (eind->dyn_relocs != NULL)
     {
+      if (edir->dyn_relocs != NULL)
+       {
+         struct elf32_hppa_dyn_reloc_entry **pp;
+         struct elf32_hppa_dyn_reloc_entry *p;
+
+         if (dir != ind->weakdef)
+           abort ();
+
+         /* Add reloc counts against the weak sym to the strong sym
+            list.  Merge any entries against the same section.  */
+         for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+           {
+             struct elf32_hppa_dyn_reloc_entry *q;
+
+             for (q = edir->dyn_relocs; q != NULL; q = q->next)
+               if (q->sec == p->sec)
+                 {
+#if RELATIVE_DYNRELOCS
+                   q->relative_count += p->relative_count;
+#endif
+                   q->count += p->count;
+                   *pp = p->next;
+                   break;
+                 }
+             if (q == NULL)
+               pp = &p->next;
+           }
+         *pp = edir->dyn_relocs;
+       }
+
       edir->dyn_relocs = eind->dyn_relocs;
       eind->dyn_relocs = NULL;
     }
-  else if (eind->dyn_relocs != NULL)
-    abort ();
 
   _bfd_elf_link_hash_copy_indirect (dir, ind);
 }
@@ -1844,6 +1872,8 @@ elf32_hppa_adjust_dynamic_symbol (info, h)
 
       return true;
     }
+  else
+    h->plt.offset = (bfd_vma) -1;
 
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
index e249304476786f6df60a3c3dce63979ec524a045..f5e64555b101492b583b8774b1a34075817bcd33 100644 (file)
@@ -637,13 +637,39 @@ elf_i386_copy_indirect_symbol (dir, ind)
   edir = (struct elf_i386_link_hash_entry *) dir;
   eind = (struct elf_i386_link_hash_entry *) ind;
 
-  if (edir->dyn_relocs == NULL)
+  if (eind->dyn_relocs != NULL)
     {
+      if (edir->dyn_relocs != NULL)
+       {
+         struct elf_i386_dyn_relocs **pp;
+         struct elf_i386_dyn_relocs *p;
+
+         if (dir != ind->weakdef)
+           abort ();
+
+         /* Add reloc counts against the weak sym to the strong sym
+            list.  Merge any entries against the same section.  */
+         for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+           {
+             struct elf_i386_dyn_relocs *q;
+
+             for (q = edir->dyn_relocs; q != NULL; q = q->next)
+               if (q->sec == p->sec)
+                 {
+                   q->pc_count += p->pc_count;
+                   q->count += p->count;
+                   *pp = p->next;
+                   break;
+                 }
+             if (q == NULL)
+               pp = &p->next;
+           }
+         *pp = edir->dyn_relocs;
+       }
+
       edir->dyn_relocs = eind->dyn_relocs;
       eind->dyn_relocs = NULL;
     }
-  else if (eind->dyn_relocs != NULL)
-    abort ();
 
   _bfd_elf_link_hash_copy_indirect (dir, ind);
 }
@@ -1086,7 +1112,7 @@ elf_i386_adjust_dynamic_symbol (info, h)
             object, or if all references were garbage collected.  In
             such a case, we don't actually need to build a procedure
             linkage table, and we can just do a PC32 reloc instead.  */
-         h->plt.refcount = -1;
+         h->plt.offset = (bfd_vma) -1;
          h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
        }
 
@@ -1098,7 +1124,7 @@ elf_i386_adjust_dynamic_symbol (info, h)
        check_relocs.  We can't decide accurately between function and
        non-function syms in check-relocs;  Objects loaded later in
        the link may change h->type.  So fix it now.  */
-    h->plt.refcount = -1;
+    h->plt.offset = (bfd_vma) -1;
 
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
index f3143497c3cff6fc74f47ed54cc79fd19a8aefe4..28bba6566d1618180e69f9d13cfcc1c8ccad28f4 100644 (file)
@@ -1797,6 +1797,8 @@ ppc_elf_adjust_dynamic_symbol (info, h)
 
       return true;
     }
+  else
+    h->plt.offset = (bfd_vma) -1;
 
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
index c8f5a8f9f0509cafb3ccfacc071da2b0f26bdb34..ca51540aaccda987ffba8ea134601de9a00c52b1 100644 (file)
@@ -998,6 +998,8 @@ elf_s390_adjust_dynamic_symbol (info, h)
 
       return true;
     }
+  else
+    h->plt.offset = (bfd_vma) -1;
 
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
index d3cdbecd8f55ff8027bbb28226ac8970206cd0dd..1bbd253d1028f047cbac2fb7ddc8c047359c1e7f 100644 (file)
@@ -1794,13 +1794,39 @@ ppc64_elf_copy_indirect_symbol (dir, ind)
   edir = (struct ppc_link_hash_entry *) dir;
   eind = (struct ppc_link_hash_entry *) ind;
 
-  if (edir->dyn_relocs == NULL)
+  if (eind->dyn_relocs != NULL)
     {
+      if (edir->dyn_relocs != NULL)
+       {
+         struct ppc_dyn_relocs **pp;
+         struct ppc_dyn_relocs *p;
+
+         if (dir != ind->weakdef)
+           abort ();
+
+         /* Add reloc counts against the weak sym to the strong sym
+            list.  Merge any entries against the same section.  */
+         for (pp = &eind->dyn_relocs; (p = *pp) != NULL; )
+           {
+             struct ppc_dyn_relocs *q;
+
+             for (q = edir->dyn_relocs; q != NULL; q = q->next)
+               if (q->sec == p->sec)
+                 {
+                   q->pc_count += p->pc_count;
+                   q->count += p->count;
+                   *pp = p->next;
+                   break;
+                 }
+             if (q == NULL)
+               pp = &p->next;
+           }
+         *pp = edir->dyn_relocs;
+       }
+
       edir->dyn_relocs = eind->dyn_relocs;
       eind->dyn_relocs = NULL;
     }
-  else if (eind->dyn_relocs != NULL)
-    abort ();
 
   _bfd_elf_link_hash_copy_indirect (dir, ind);
 }
@@ -2366,6 +2392,8 @@ ppc64_elf_adjust_dynamic_symbol (info, h)
        }
       return true;
     }
+  else
+    h->plt.offset = (bfd_vma) -1;
 
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
index aeba8559add8fd8eb38ecf6ab67a0599c86333ba..ebe30f5f5a31eb084486814be61e2088b1b9fda6 100644 (file)
@@ -976,6 +976,8 @@ elf_s390_adjust_dynamic_symbol (info, h)
 
       return true;
     }
+  else
+    h->plt.offset = (bfd_vma) -1;
 
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
index 321542165c1fba68b2d4166f00b6e184dcaaf928..9be552d41813488e0cd8f18f51b0510ed90a0cca 100644 (file)
@@ -854,6 +854,8 @@ elf64_x86_64_adjust_dynamic_symbol (info, h)
 
       return true;
     }
+  else
+    h->plt.offset = (bfd_vma) -1;
 
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
This page took 0.039357 seconds and 4 git commands to generate.