* elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Merge dyn_reloc
[deliverable/binutils-gdb.git] / bfd / elf32-hppa.c
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
This page took 0.027642 seconds and 4 git commands to generate.