Rename bfd_elf_get_arch_size to bfd_get_arch_size
[deliverable/binutils-gdb.git] / bfd / elf.c
index 26249c49d4cd084b9198d4562e81b85951e94882..d22e57b6f8477d48324891394dca5fc8b9d4e646 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -954,7 +954,8 @@ _bfd_elf_link_hash_copy_indirect (dir, ind)
 }
 
 void
-_bfd_elf_link_hash_hide_symbol(h)
+_bfd_elf_link_hash_hide_symbol(info, h)
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      struct elf_link_hash_entry *h;
 {
   h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
@@ -1332,8 +1333,10 @@ bfd_section_from_shdr (abfd, shindex)
        /* If this reloc section does not use the main symbol table we
           don't treat it as a reloc section.  BFD can't adequately
           represent such a section, so at least for now, we don't
-          try.  We just present it as a normal section.  */
-       if (hdr->sh_link != elf_onesymtab (abfd))
+          try.  We just present it as a normal section.  We also 
+          can't use it as a reloc section if it points to the null
+          section. */
+       if (hdr->sh_link != elf_onesymtab (abfd) || hdr->sh_info == SHN_UNDEF)
          return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
 
        if (! bfd_section_from_shdr (abfd, hdr->sh_info))
@@ -1758,22 +1761,6 @@ elf_fake_sections (abfd, asect, failedptrarg)
     *failedptr = true;
 }
 
-/* Get elf arch size (32 / 64).
-   Returns -1 if not elf.  */
-
-int
-bfd_elf_get_arch_size (abfd)
-     bfd *abfd;
-{
-  if (abfd->xvec->flavour != bfd_target_elf_flavour)
-    {
-      bfd_set_error (bfd_error_wrong_format);
-      return -1;
-    }
-
-  return (get_elf_backend_data (abfd))->s->arch_size;
-}
-
 /* Assign all ELF section numbers.  The dummy first section is handled here
    too.  The link/info pointers for the standard section types are filled
    in here too, while we're at it.  */
@@ -1920,7 +1907,7 @@ assign_section_numbers (abfd)
 
                  /* This is a .stab section.  */
                  elf_section_data (s)->this_hdr.sh_entsize =
-                   4 + 2 * bfd_elf_get_arch_size (abfd) / 8;
+                   4 + 2 * bfd_get_arch_size (abfd) / 8;
                }
            }
          break;
@@ -3250,7 +3237,7 @@ prep_headers (abfd)
       i_ehdrp->e_machine = EM_NONE;
       break;
     case bfd_arch_sparc:
-      if (bfd_elf_get_arch_size (abfd) == 64)
+      if (bfd_get_arch_size (abfd) == 64)
        i_ehdrp->e_machine = EM_SPARCV9;
       else
        i_ehdrp->e_machine = EM_SPARC;
@@ -3264,6 +3251,12 @@ prep_headers (abfd)
     case bfd_arch_ia64:
       i_ehdrp->e_machine = EM_IA_64;
       break;
+    case bfd_arch_m68hc11:
+      i_ehdrp->e_machine = EM_68HC11;
+      break;
+    case bfd_arch_m68hc12:
+      i_ehdrp->e_machine = EM_68HC12;
+      break;
     case bfd_arch_m68k:
       i_ehdrp->e_machine = EM_68K;
       break;
@@ -5127,11 +5120,13 @@ elfcore_grok_prstatus (abfd, note)
   char buf[100];
   char* name;
   asection* sect;
+  int raw_size;
 
   if (note->descsz == sizeof (prstatus_t))
     {
       prstatus_t prstat;
 
+      raw_size = sizeof (prstat.pr_reg);
       memcpy (&prstat, note->descdata, sizeof (prstat));
 
       elf_tdata (abfd)->core_signal = prstat.pr_cursig;
@@ -5153,6 +5148,7 @@ elfcore_grok_prstatus (abfd, note)
       /* 64-bit host, 32-bit corefile */
       prstatus32_t prstat;
 
+      raw_size = sizeof (prstat.pr_reg);
       memcpy (&prstat, note->descdata, sizeof (prstat));
 
       elf_tdata (abfd)->core_signal = prstat.pr_cursig;
@@ -5190,13 +5186,13 @@ elfcore_grok_prstatus (abfd, note)
 
   if (note->descsz == sizeof (prstatus_t))
     {
-      sect->_raw_size = sizeof (prgregset_t);
+      sect->_raw_size = raw_size;
       sect->filepos = note->descpos + offsetof (prstatus_t, pr_reg);
     }
 #if defined (__sparcv9)
   else if (note->descsz == sizeof (prstatus32_t))
     {
-      sect->_raw_size = sizeof (prgregset32_t);
+      sect->_raw_size = raw_size;
       sect->filepos = note->descpos + offsetof (prstatus32_t, pr_reg);
     }
 #endif
This page took 0.025651 seconds and 4 git commands to generate.