* elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table
authorAlan Modra <amodra@gmail.com>
Tue, 16 Apr 2002 04:58:12 +0000 (04:58 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 16 Apr 2002 04:58:12 +0000 (04:58 +0000)
type rather than just assuming entries are ELF.
* elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
* elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
* elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise.
* elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry
rather than elf_link_hash_entry.

bfd/ChangeLog
bfd/elf32-m32r.c
bfd/elf32-sh64.c
bfd/elf64-mmix.c
bfd/elf64-sh64.c
bfd/elf64-sparc.c

index 997e4b22d51c8b483da912400a9e551b1f06471f..4894d775b27c1abb3f6c877f9cf2ba6c609feda1 100644 (file)
@@ -1,3 +1,13 @@
+2002-04-16  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table
+       type rather than just assuming entries are ELF.
+       * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
+       * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
+       * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise.
+       * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry
+       rather than elf_link_hash_entry.
+
 2002-04-15  Richard Henderson  <rth@redhat.com>
 
        * elf32-mips.c (mips_elf32_object_p): Revert 0404 fragment: allow
@@ -8,7 +18,7 @@
        * opncls.c (bfd_close): Write contents if writeable.
        Minor formatting tidy-ups.
 
-2002-04-15  Alan Modra  <alan@weed.local>
+2002-04-15  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type.
 
index 1ce1827acae511bdd4feb443076596f7f06e8b77..b3b6220489369a48ae43b88e5965f3c0ae0a902e 100644 (file)
@@ -838,7 +838,8 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
 {
   if (! info->relocateable
       && (*namep)[0] == '_' && (*namep)[1] == 'S'
-      && strcmp (*namep, "_SDA_BASE_") == 0)
+      && strcmp (*namep, "_SDA_BASE_") == 0
+      && info->hash->creator->flavour == bfd_target_elf_flavour)
     {
       /* This is simpler than using _bfd_elf_create_linker_section
         (our needs are simpler than ppc's needs).  Also
index 5c85d36c2dd29bd3a90ddae3479d2ecc174448af..5e7ccdd68223b57819623e164ba8a35592a5c9c1 100644 (file)
@@ -389,7 +389,8 @@ sh64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd_vma *valp;
 {
   /* We want to do this for relocatable as well as final linking.  */
-  if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL)
+  if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL
+      && info->hash->creator->flavour == bfd_target_elf_flavour)
     {
       struct elf_link_hash_entry *h;
 
index 3bda435c987cc9727fc94752bfaf1a6531d9c924..96146ed016e2fdaec00af44561d35d96bce654c1 100644 (file)
@@ -1953,16 +1953,16 @@ mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
                       strlen (MMIX_LOC_SECTION_START_SYMBOL_PREFIX)) == 0)
     {
       /* See if we have another one.  */
-      struct elf_link_hash_entry *h
-       = (struct elf_link_hash_entry *) bfd_link_hash_lookup (info->hash,
-                                                              *namep,
-                                                              false,
-                                                              false, false);
+      struct bfd_link_hash_entry *h = bfd_link_hash_lookup (info->hash,
+                                                           *namep,
+                                                           false,
+                                                           false,
+                                                           false);
 
-      if (h != NULL && h->root.type != bfd_link_hash_undefined)
+      if (h != NULL && h->type != bfd_link_hash_undefined)
        {
          /* How do we get the asymbol (or really: the filename) from h?
-            h->root.u.def.section->owner is NULL.  */
+            h->u.def.section->owner is NULL.  */
          ((*_bfd_error_handler)
           (_("%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n"),
            bfd_get_filename (abfd), *namep,
index aac491af4a613ff729e3a03dbb592118f8e706d4..b168934e9633c89b8a803844f9cdee6b3c5c2d3c 100644 (file)
@@ -2929,7 +2929,8 @@ sh64_elf64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd_vma *valp;
 {
   /* We want to do this for relocatable as well as final linking.  */
-  if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL)
+  if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL
+      && info->hash->creator->flavour == bfd_target_elf_flavour)
     {
       struct elf_link_hash_entry *h;
 
index 8df7e319522d0eb8d2e9a776978e84a07313a3e8..4933f8de801e92682fef8bff680dfe81b013bd5a 100644 (file)
@@ -1385,9 +1385,8 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
       *namep = NULL;
       return true;
     }
-  else if (! *namep || ! **namep)
-    return true;
-  else
+  else if (*namep && **namep
+          && info->hash->creator->flavour == bfd_target_elf_flavour)
     {
       int i;
       struct sparc64_elf_app_reg *p;