bfd/
[deliverable/binutils-gdb.git] / bfd / elf32-vax.c
index 1aca042c61c6669f1efc59e7aef03909615c77d0..919bcf601e80c5b56a0aa418d40b554e925aaea0 100644 (file)
@@ -1,6 +1,6 @@
 /* VAX series support for 32-bit ELF
-   Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+   2004, 2005 Free Software Foundation, Inc.
    Contributed by Matt Thomas <matt@3am-software.com>.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -17,7 +17,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02110-1301, USA.  */
 
 #include "bfd.h"
 #include "sysdep.h"
@@ -578,7 +578,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
   asection *srelgot;
   asection *sreloc;
 
-  if (info->relocateable)
+  if (info->relocatable)
     return TRUE;
 
   dynobj = elf_hash_table (info)->dynobj;
@@ -682,7 +682,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
          if (h == NULL)
            continue;
 
-         h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+         h->needs_plt = 1;
          if (h->plt.refcount == -1)
            h->plt.refcount = 1;
          else
@@ -706,8 +706,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
                && (sec->flags & SEC_ALLOC) != 0
                && h != NULL
                && (!info->symbolic
-                   || (h->elf_link_hash_flags
-                       & ELF_LINK_HASH_DEF_REGULAR) == 0)))
+                   || !h->def_regular)))
            {
              if (h != NULL)
                {
@@ -777,7 +776,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
                    info->flags |= DF_TEXTREL;
                }
 
-             sreloc->_raw_size += sizeof (Elf32_External_Rela);
+             sreloc->size += sizeof (Elf32_External_Rela);
 
              /* If we are linking with -Bsymbolic, we count the number of
                 PC relative relocations we have entered for this symbol,
@@ -821,14 +820,14 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
          /* This relocation describes the C++ object vtable hierarchy.
             Reconstruct it for later use during GC.  */
        case R_VAX_GNU_VTINHERIT:
-         if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+         if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
            return FALSE;
          break;
 
          /* This relocation describes which C++ vtable entries are actually
             used.  Record for later use during GC.  */
        case R_VAX_GNU_VTENTRY:
-         if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+         if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
            return FALSE;
          break;
 
@@ -892,30 +891,35 @@ elf_vax_gc_sweep_hook (abfd, info, sec, relocs)
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
   const Elf_Internal_Rela *rel, *relend;
-  unsigned long r_symndx;
-  struct elf_link_hash_entry *h;
   bfd *dynobj;
 
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
-  sym_hashes = elf_sym_hashes (abfd);
-
   dynobj = elf_hash_table (info)->dynobj;
   if (dynobj == NULL)
     return TRUE;
 
+  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  sym_hashes = elf_sym_hashes (abfd);
+
   relend = relocs + sec->reloc_count;
   for (rel = relocs; rel < relend; rel++)
     {
+      unsigned long r_symndx;
+      struct elf_link_hash_entry *h = NULL;
+
+      r_symndx = ELF32_R_SYM (rel->r_info);
+      if (r_symndx >= symtab_hdr->sh_info)
+       {
+         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;
+       }
+
       switch (ELF32_R_TYPE (rel->r_info))
        {
        case R_VAX_GOT32:
-         r_symndx = ELF32_R_SYM (rel->r_info);
-         if (r_symndx >= symtab_hdr->sh_info)
-           {
-             h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-             if (h->got.refcount > 0)
-               --h->got.refcount;
-           }
+         if (h != NULL && h->got.refcount > 0)
+           --h->got.refcount;
          break;
 
        case R_VAX_PLT32:
@@ -925,13 +929,8 @@ elf_vax_gc_sweep_hook (abfd, info, sec, relocs)
        case R_VAX_8:
        case R_VAX_16:
        case R_VAX_32:
-         r_symndx = ELF32_R_SYM (rel->r_info);
-         if (r_symndx >= symtab_hdr->sh_info)
-           {
-             h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-             if (h->plt.refcount > 0)
-               --h->plt.refcount;
-           }
+         if (h != NULL && h->plt.refcount > 0)
+           --h->plt.refcount;
          break;
 
        default:
@@ -961,24 +960,21 @@ elf_vax_adjust_dynamic_symbol (info, h)
 
   /* Make sure we know what is going on here.  */
   BFD_ASSERT (dynobj != NULL
-             && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
-                 || h->weakdef != NULL
-                 || ((h->elf_link_hash_flags
-                      & ELF_LINK_HASH_DEF_DYNAMIC) != 0
-                     && (h->elf_link_hash_flags
-                         & ELF_LINK_HASH_REF_REGULAR) != 0
-                     && (h->elf_link_hash_flags
-                         & ELF_LINK_HASH_DEF_REGULAR) == 0)));
+             && (h->needs_plt
+                 || h->u.weakdef != NULL
+                 || (h->def_dynamic
+                     && h->ref_regular
+                     && !h->def_regular)));
 
   /* If this is a function, put it in the procedure linkage table.  We
      will fill in the contents of the procedure linkage table later,
      when we know the address of the .got section.  */
   if (h->type == STT_FUNC
-      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
+      || h->needs_plt)
     {
       if (! info->shared
-         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
-         && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
+         && !h->def_dynamic
+         && !h->ref_dynamic
          /* We must always create the plt entry if it was referenced
             by a PLTxxO relocation.  In this case we already recorded
             it as a dynamic symbol.  */
@@ -989,7 +985,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
             object.  In such a case, we don't actually need to build
             a procedure linkage table, and we can just do a PCxx
             reloc instead.  */
-         BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
+         BFD_ASSERT (h->needs_plt);
          h->plt.offset = (bfd_vma) -1;
          return TRUE;
        }
@@ -997,7 +993,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
       /* GC may have rendered this entry unused.  */
       if (h->plt.refcount <= 0)
        {
-         h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+         h->needs_plt = 0;
          h->plt.offset = (bfd_vma) -1;
          return TRUE;
        }
@@ -1005,7 +1001,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (h->dynindx == -1)
        {
-         if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+         if (! bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
        }
 
@@ -1014,9 +1010,9 @@ elf_vax_adjust_dynamic_symbol (info, h)
 
       /* If this is the first .plt entry, make room for the special
         first entry.  */
-      if (s->_raw_size == 0)
+      if (s->size == 0)
        {
-         s->_raw_size += PLT_ENTRY_SIZE;
+         s->size += PLT_ENTRY_SIZE;
        }
 
       /* If this symbol is not defined in a regular file, and we are
@@ -1025,29 +1021,29 @@ elf_vax_adjust_dynamic_symbol (info, h)
         pointers compare as equal between the normal executable and
         the shared library.  */
       if (!info->shared
-         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+         && !h->def_regular)
        {
          h->root.u.def.section = s;
-         h->root.u.def.value = s->_raw_size;
+         h->root.u.def.value = s->size;
        }
 
-      h->plt.offset = s->_raw_size;
+      h->plt.offset = s->size;
 
       /* Make room for this entry.  */
-      s->_raw_size += PLT_ENTRY_SIZE;
+      s->size += PLT_ENTRY_SIZE;
 
       /* We also need to make an entry in the .got.plt section, which
         will be placed in the .got section by the linker script.  */
 
       s = bfd_get_section_by_name (dynobj, ".got.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += 4;
+      s->size += 4;
 
       /* We also need to make an entry in the .rela.plt section.  */
 
       s = bfd_get_section_by_name (dynobj, ".rela.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += sizeof (Elf32_External_Rela);
+      s->size += sizeof (Elf32_External_Rela);
 
       return TRUE;
     }
@@ -1059,12 +1055,12 @@ elf_vax_adjust_dynamic_symbol (info, h)
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->weakdef != NULL)
+  if (h->u.weakdef != NULL)
     {
-      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
-                 || h->weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->weakdef->root.u.def.section;
-      h->root.u.def.value = h->weakdef->root.u.def.value;
+      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
+                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->u.weakdef->root.u.def.section;
+      h->root.u.def.value = h->u.weakdef->root.u.def.value;
       return TRUE;
     }
 
@@ -1101,8 +1097,8 @@ elf_vax_adjust_dynamic_symbol (info, h)
 
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf32_External_Rela);
-      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
+      srel->size += sizeof (Elf32_External_Rela);
+      h->needs_copy = 1;
     }
 
   /* We need to figure out the alignment required for this symbol.  I
@@ -1112,8 +1108,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
     power_of_two = 3;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-                           (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (!bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -1122,10 +1117,10 @@ elf_vax_adjust_dynamic_symbol (info, h)
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
@@ -1149,11 +1144,11 @@ elf_vax_size_dynamic_sections (output_bfd, info)
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       /* Set the contents of the .interp section to the interpreter.  */
-      if (!info->shared)
+      if (info->executable)
        {
          s = bfd_get_section_by_name (dynobj, ".interp");
          BFD_ASSERT (s != NULL);
-         s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+         s->size = sizeof ELF_DYNAMIC_INTERPRETER;
          s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
        }
     }
@@ -1166,13 +1161,13 @@ elf_vax_size_dynamic_sections (output_bfd, info)
         file below.  */
       s = bfd_get_section_by_name (dynobj, ".rela.got");
       if (s != NULL)
-       s->_raw_size = 0;
+       s->size = 0;
       s = bfd_get_section_by_name (dynobj, ".got.plt");
       if (s != NULL)
-       s->_raw_size = 0;
+       s->size = 0;
       s = bfd_get_section_by_name (dynobj, ".got");
       if (s != NULL)
-       s->_raw_size = 0;
+       s->size = 0;
     }
 
   /* If this is a -Bsymbolic shared link, then we need to discard all PC
@@ -1213,7 +1208,7 @@ elf_vax_size_dynamic_sections (output_bfd, info)
 
       if (strcmp (name, ".plt") == 0)
        {
-         if (s->_raw_size == 0)
+         if (s->size == 0)
            {
              /* Strip this section if we don't need it; see the
                  comment below.  */
@@ -1227,7 +1222,7 @@ elf_vax_size_dynamic_sections (output_bfd, info)
        }
       else if (strncmp (name, ".rela", 5) == 0)
        {
-         if (s->_raw_size == 0)
+         if (s->size == 0)
            {
              /* If we don't need this section, strip it from the
                 output file.  This is mostly to handle .rela.bss and
@@ -1278,13 +1273,13 @@ elf_vax_size_dynamic_sections (output_bfd, info)
 
       if (strip)
        {
-         _bfd_strip_section_from_output (info, s);
+         s->flags |= SEC_EXCLUDE;
          continue;
        }
 
       /* Allocate memory for the section contents.  */
-      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
        return FALSE;
     }
 
@@ -1296,7 +1291,7 @@ elf_vax_size_dynamic_sections (output_bfd, info)
         the .dynamic section.  The DT_DEBUG entry is filled in by the
         dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (!info->shared)
        {
@@ -1338,7 +1333,6 @@ elf_vax_size_dynamic_sections (output_bfd, info)
    in regular objects.  We allocated space for them in the check_relocs
    routine, but we won't fill them in in the relocate_section routine.  */
 
-/*ARGSUSED*/
 static bfd_boolean
 elf_vax_discard_copies (h, ignore)
      struct elf_vax_link_hash_entry *h;
@@ -1350,11 +1344,11 @@ elf_vax_discard_copies (h, ignore)
     h = (struct elf_vax_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)
+  if (!h->root.def_regular)
     return TRUE;
 
   for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
-    s->section->_raw_size -= s->count * sizeof (Elf32_External_Rela);
+    s->section->size -= s->count * sizeof (Elf32_External_Rela);
 
   return TRUE;
 }
@@ -1366,7 +1360,6 @@ elf_vax_discard_copies (h, ignore)
    creating a shared object or executable, space in the .got and .rela.got
    will be reserved for the symbol.  */
 
-/*ARGSUSED*/
 static bfd_boolean
 elf_vax_instantiate_got_entries (h, infoptr)
      struct elf_link_hash_entry *h;
@@ -1401,13 +1394,13 @@ elf_vax_instantiate_got_entries (h, infoptr)
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (h->dynindx == -1)
        {
-         if (!bfd_elf32_link_record_dynamic_symbol (info, h))
+         if (!bfd_elf_link_record_dynamic_symbol (info, h))
            return FALSE;
        }
 
       /* Allocate space in the .got and .rela.got sections.  */
-      sgot->_raw_size += 4;
-      srelgot->_raw_size += sizeof (Elf32_External_Rela);
+      sgot->size += 4;
+      srelgot->size += sizeof (Elf32_External_Rela);
     }
 
   return TRUE;
@@ -1440,7 +1433,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  if (info->relocateable)
+  if (info->relocatable)
     return TRUE;
 
   dynobj = elf_hash_table (info)->dynobj;
@@ -1483,19 +1476,21 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
        {
          sym = local_syms + r_symndx;
          sec = local_sections[r_symndx];
-         relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
+         relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
        }
       else
        {
-         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;
-         if (h->root.type == bfd_link_hash_defined
+         bfd_boolean unresolved_reloc;
+         bfd_boolean warned;
+
+         RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+                                  r_symndx, symtab_hdr, sym_hashes,
+                                  h, sec, relocation,
+                                  unresolved_reloc, warned);
+          
+         if ((h->root.type == bfd_link_hash_defined
              || h->root.type == bfd_link_hash_defweak)
-           {
-             sec = h->root.u.def.section;
-             if ((r_type == R_VAX_PLT32
+             && ((r_type == R_VAX_PLT32
                   && h->plt.offset != (bfd_vma) -1
                   && elf_hash_table (info)->dynamic_sections_created)
                  || (r_type == R_VAX_GOT32
@@ -1504,12 +1499,10 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                      && elf_hash_table (info)->dynamic_sections_created
                      && (! info->shared
                          || (! info->symbolic && h->dynindx != -1)
-                         || (h->elf_link_hash_flags
-                             & ELF_LINK_HASH_DEF_REGULAR) == 0))
+                         || !h->def_regular))
                  || (info->shared
                      && ((! info->symbolic && h->dynindx != -1)
-                         || (h->elf_link_hash_flags
-                             & ELF_LINK_HASH_DEF_REGULAR) == 0)
+                         || !h->def_regular)
                      && ((input_section->flags & SEC_ALLOC) != 0
                          /* DWARF will emit R_VAX_32 relocations in its
                             sections against symbols defined externally
@@ -1517,41 +1510,17 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                             with them here.  */
 
                          || ((input_section->flags & SEC_DEBUGGING) != 0
-                             && (h->elf_link_hash_flags
-                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
+                             && h->def_dynamic))
                      && (r_type == R_VAX_8
                          || r_type == R_VAX_16
                          || r_type == R_VAX_32
                          || r_type == R_VAX_PC8
                          || r_type == R_VAX_PC16
-                         || r_type == R_VAX_PC32)))
-               {
-                 /* In these cases, we don't need the relocation
-                    value.  We check specially because in some
-                    obscure cases sec->output_section will be NULL.  */
-                 relocation = 0;
-               }
-             else
-               relocation = (h->root.u.def.value
-                             + sec->output_section->vma
-                             + sec->output_offset);
-           }
-         else if (h->root.type == bfd_link_hash_undefweak)
+                         || r_type == R_VAX_PC32))))
+           /* In these cases, we don't need the relocation
+              value.  We check specially because in some
+              obscure cases sec->output_section will be NULL.  */
            relocation = 0;
-         else if (info->shared
-                  && !info->no_undefined
-                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
-           relocation = 0;
-         else
-           {
-             if (!(info->callbacks->undefined_symbol
-                   (info, h->root.root.string, input_bfd,
-                    input_section, rel->r_offset,
-                    (!info->shared || info->no_undefined
-                     || ELF_ST_VISIBILITY (h->other)))))
-               return FALSE;
-             relocation = 0;
-           }
        }
 
       switch (r_type)
@@ -1577,11 +1546,11 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
            BFD_ASSERT (h != NULL);
            off = h->got.offset;
            BFD_ASSERT (off != (bfd_vma) -1);
-           BFD_ASSERT (off < sgot->_raw_size);
+           BFD_ASSERT (off < sgot->size);
 
            if (info->shared
                && h->dynindx == -1
-               && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+               && h->def_regular)
              {
                /* The symbol was forced to be local
                   because of a version file..  We must initialize
@@ -1688,8 +1657,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                   && r_type != R_VAX_PC16
                   && r_type != R_VAX_PC32)
                  || (!info->symbolic
-                     || (h->elf_link_hash_flags
-                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
+                     || !h->def_regular)))
            {
              Elf_Internal_Rela outrel;
              bfd_byte *loc;
@@ -1737,8 +1705,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                  become local.  */
              else if (h != NULL
                       && ((! info->symbolic && h->dynindx != -1)
-                          || (h->elf_link_hash_flags
-                              & ELF_LINK_HASH_DEF_REGULAR) == 0))
+                          || !h->def_regular))
                {
                  BFD_ASSERT (h->dynindx != -1);
                  outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
@@ -1758,16 +1725,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                    {
                      long indx;
 
-                     if (h == NULL)
-                       sec = local_sections[r_symndx];
-                     else
-                       {
-                         BFD_ASSERT (h->root.type == bfd_link_hash_defined
-                                     || (h->root.type
-                                         == bfd_link_hash_defweak));
-                         sec = h->root.u.def.section;
-                       }
-                     if (sec != NULL && bfd_is_abs_section (sec))
+                     if (bfd_is_abs_section (sec))
                        indx = 0;
                      else if (sec == NULL || sec->owner == NULL)
                        {
@@ -1855,7 +1813,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                const char *name;
 
                if (h != NULL)
-                 name = h->root.root.string;
+                 name = NULL;
                else
                  {
                    name = bfd_elf_string_from_elf_section (input_bfd,
@@ -1867,8 +1825,9 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                      name = bfd_section_name (input_bfd, sec);
                  }
                if (!(info->callbacks->reloc_overflow
-                     (info, name, howto->name, (bfd_vma) 0,
-                      input_bfd, input_section, rel->r_offset)))
+                     (info, (h ? &h->root : NULL), name, howto->name,
+                      (bfd_vma) 0, input_bfd, input_section,
+                      rel->r_offset)))
                  return FALSE;
              }
              break;
@@ -1955,7 +1914,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
       loc = srela->contents + plt_index * sizeof (Elf32_External_Rela);
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
 
-      if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+      if (!h->def_regular)
        {
          /* Mark the symbol as undefined, rather than as defined in
             the .plt section.  Leave the value alone.  */
@@ -1986,7 +1945,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
         the relocate_section function.  */
       if (info->shared
          && h->dynindx == -1
-         && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+         && h->def_regular)
        {
          rela.r_info = ELF32_R_INFO (0, R_VAX_RELATIVE);
        }
@@ -2003,7 +1962,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
       bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
     }
 
-  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
+  if (h->needs_copy)
     {
       asection *s;
       Elf_Internal_Rela rela;
@@ -2061,7 +2020,7 @@ elf_vax_finish_dynamic_sections (output_bfd, info)
       BFD_ASSERT (splt != NULL && sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
        {
          Elf_Internal_Dyn dyn;
@@ -2090,10 +2049,7 @@ elf_vax_finish_dynamic_sections (output_bfd, info)
            case DT_PLTRELSZ:
              s = bfd_get_section_by_name (output_bfd, ".rela.plt");
              BFD_ASSERT (s != NULL);
-             if (s->_cooked_size != 0)
-               dyn.d_un.d_val = s->_cooked_size;
-             else
-               dyn.d_un.d_val = s->_raw_size;
+             dyn.d_un.d_val = s->size;
              bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
              break;
 
@@ -2107,19 +2063,14 @@ elf_vax_finish_dynamic_sections (output_bfd, info)
                 about changing the DT_RELA entry.  */
              s = bfd_get_section_by_name (output_bfd, ".rela.plt");
              if (s != NULL)
-               {
-                 if (s->_cooked_size != 0)
-                   dyn.d_un.d_val -= s->_cooked_size;
-                 else
-                   dyn.d_un.d_val -= s->_raw_size;
-               }
+               dyn.d_un.d_val -= s->size;
              bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
              break;
            }
        }
 
       /* Fill in the first entry in the procedure linkage table.  */
-      if (splt->_raw_size > 0)
+      if (splt->size > 0)
        {
          memcpy (splt->contents, elf_vax_plt0_entry, PLT_ENTRY_SIZE);
          bfd_put_32 (output_bfd,
@@ -2138,7 +2089,7 @@ elf_vax_finish_dynamic_sections (output_bfd, info)
     }
 
   /* Fill in the first three entries in the global offset table.  */
-  if (sgot->_raw_size > 0)
+  if (sgot->size > 0)
     {
       if (sdyn == NULL)
        bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
@@ -2164,7 +2115,7 @@ elf_vax_finish_dynamic_sections (output_bfd, info)
                                        _bfd_elf_create_dynamic_sections
 #define bfd_elf32_bfd_link_hash_table_create \
                                        elf_vax_link_hash_table_create
-#define bfd_elf32_bfd_final_link       _bfd_elf32_gc_common_final_link
+#define bfd_elf32_bfd_final_link       bfd_elf_gc_common_final_link
 
 #define elf_backend_check_relocs       elf_vax_check_relocs
 #define elf_backend_adjust_dynamic_symbol \
This page took 0.033169 seconds and 4 git commands to generate.