Fix SH2A machine variants in order to correctly select instruction inheritance
[deliverable/binutils-gdb.git] / bfd / elf32-sparc.c
index be3dfae3e1acb47e8a51071b76f90b769dcd661a..1669aaa874efe7d0399b20881deae3ab4eae584c 100644 (file)
@@ -1,6 +1,6 @@
 /* SPARC-specific support for 32-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004 Free Software Foundation, Inc.
+   2003, 2004, 2005 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -695,7 +695,7 @@ elf32_sparc_link_hash_table_create (abfd)
   struct elf32_sparc_link_hash_table *ret;
   bfd_size_type amt = sizeof (struct elf32_sparc_link_hash_table);
 
-  ret = (struct elf32_sparc_link_hash_table *) bfd_malloc (amt);
+  ret = (struct elf32_sparc_link_hash_table *) bfd_zmalloc (amt);
   if (ret == NULL)
     return NULL;
 
@@ -705,15 +705,6 @@ elf32_sparc_link_hash_table_create (abfd)
       return NULL;
     }
 
-  ret->sgot = NULL;
-  ret->srelgot = NULL;
-  ret->splt = NULL;
-  ret->srelplt = NULL;
-  ret->sdynbss = NULL;
-  ret->srelbss = NULL;
-  ret->tls_ldm_got.refcount = 0;
-  ret->sym_sec.abfd = NULL;
-
   return &ret->elf.root;
 }
 
@@ -732,15 +723,16 @@ create_got_section (dynobj, info)
 
   htab = elf32_sparc_hash_table (info);
   htab->sgot = bfd_get_section_by_name (dynobj, ".got");
-  if (!htab->sgot)
-    abort ();
+  BFD_ASSERT (htab->sgot != NULL);
 
   htab->srelgot = bfd_make_section (dynobj, ".rela.got");
   if (htab->srelgot == NULL
-      || ! bfd_set_section_flags (dynobj, htab->srelgot,
-                                 (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
-                                  | SEC_IN_MEMORY | SEC_LINKER_CREATED
-                                  | SEC_READONLY))
+      || ! bfd_set_section_flags (dynobj, htab->srelgot, SEC_ALLOC
+                                                        | SEC_LOAD
+                                                        | SEC_HAS_CONTENTS
+                                                        | SEC_IN_MEMORY
+                                                        | SEC_LINKER_CREATED
+                                                        | SEC_READONLY)
       || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2))
     return FALSE;
   return TRUE;
@@ -1353,6 +1345,9 @@ elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs)
          struct elf32_sparc_dyn_relocs *p;
 
          h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+         while (h->root.type == bfd_link_hash_indirect
+                || h->root.type == bfd_link_hash_warning)
+           h = (struct elf_link_hash_entry *) h->root.u.i.link;
          eh = (struct elf32_sparc_link_hash_entry *) h;
          for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
            if (p->sec == sec)
This page took 0.025184 seconds and 4 git commands to generate.