2002-04-21 David S. Miller <davem@redhat.com>
[deliverable/binutils-gdb.git] / bfd / elf32-sh.c
index d8d4a6aab4d10803bed7c2775dadb264b132c468..ef737b5132f4e74ba3b6512becf091cfd56de11c 100644 (file)
@@ -3529,14 +3529,14 @@ sh_elf_link_hash_table_create (abfd)
   struct elf_sh_link_hash_table *ret;
   bfd_size_type amt = sizeof (struct elf_sh_link_hash_table);
 
-  ret = (struct elf_sh_link_hash_table *) bfd_alloc (abfd, amt);
+  ret = (struct elf_sh_link_hash_table *) bfd_malloc (amt);
   if (ret == (struct elf_sh_link_hash_table *) NULL)
     return NULL;
 
   if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
                                       sh_elf_link_hash_newfunc))
     {
-      bfd_release (abfd, ret);
+      free (ret);
       return NULL;
     }
 
@@ -3899,8 +3899,8 @@ sh_elf_size_dynamic_sections (output_bfd, info)
      will not fill them in in the relocate_section routine.  */
   if (info->shared && info->symbolic)
     sh_elf_link_hash_traverse (sh_elf_hash_table (info),
-                                sh_elf_discard_copies,
-                                (PTR) NULL);
+                              sh_elf_discard_copies,
+                              (PTR) NULL);
 
   /* The check_relocs and adjust_dynamic_symbol entry points have
      determined the sizes of the various dynamic sections.  Allocate
@@ -4038,6 +4038,9 @@ sh_elf_discard_copies (h, ignore)
 {
   struct elf_sh_pcrel_relocs_copied *s;
 
+  if (h->root.root.type == bfd_link_hash_warning)
+    h = (struct elf_sh_link_hash_entry *) h->root.root.u.i.link;
+
   /* We only discard relocs for symbols defined in a regular object.  */
   if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
     return true;
This page took 0.023483 seconds and 4 git commands to generate.