* elflink.h (elf_link_output_extsym): Don't output symbols from
[deliverable/binutils-gdb.git] / bfd / elf32-vax.c
index ad04283b3352016853bfc7c90d00a5f13bc5b7f3..068578bb24575bed2f9d1020b7c2f3858463e194 100644 (file)
@@ -38,7 +38,7 @@ static boolean elf_vax_check_relocs
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
           const Elf_Internal_Rela *));
 static asection *elf_vax_gc_mark_hook
-  PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
+  PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
           struct elf_link_hash_entry *, Elf_Internal_Sym *));
 static boolean elf_vax_gc_sweep_hook
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
@@ -341,8 +341,6 @@ reloc_type_lookup (abfd, code)
 #define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup
 #define ELF_ARCH bfd_arch_vax
 /* end code generated by elf.el */
-
-#define USE_RELA
 \f
 /* Functions for the VAX ELF linker.  */
 
@@ -542,13 +540,13 @@ elf32_vax_print_private_bfd_data (abfd, ptr)
   /* xgettext:c-format */
   fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
 
-  if (elf_elfheader (abfd)->e_flags & EF_NONPIC)
+  if (elf_elfheader (abfd)->e_flags & EF_VAX_NONPIC)
     fprintf (file, _(" [nonpic]"));
 
-  if (elf_elfheader (abfd)->e_flags & EF_DFLOAT)
+  if (elf_elfheader (abfd)->e_flags & EF_VAX_DFLOAT)
     fprintf (file, _(" [d-float]"));
 
-  if (elf_elfheader (abfd)->e_flags & EF_GFLOAT)
+  if (elf_elfheader (abfd)->e_flags & EF_VAX_GFLOAT)
     fprintf (file, _(" [g-float]"));
 
   fputc ('\n', file);
@@ -675,7 +673,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
                              bfd_get_filename (abfd), rel->r_addend,
                              h->root.root.string,
                              eh->got_addend);
-               
+
                }
            }
          break;
@@ -855,8 +853,8 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
    relocation.  */
 
 static asection *
-elf_vax_gc_mark_hook (abfd, info, rel, h, sym)
-     bfd *abfd;
+elf_vax_gc_mark_hook (sec, info, rel, h, sym)
+     asection *sec;
      struct bfd_link_info *info ATTRIBUTE_UNUSED;
      Elf_Internal_Rela *rel;
      struct elf_link_hash_entry *h;
@@ -886,15 +884,7 @@ elf_vax_gc_mark_hook (abfd, info, rel, h, sym)
        }
     }
   else
-    {
-      if (!(elf_bad_symtab (abfd)
-           && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
-         && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
-               && sym->st_shndx != SHN_COMMON))
-       {
-         return bfd_section_from_elf_index (abfd, sym->st_shndx);
-       }
-    }
+    return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
 
   return NULL;
 }
@@ -1427,6 +1417,9 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
+  if (info->relocateable)
+    return true;
+
   dynobj = elf_hash_table (info)->dynobj;
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (input_bfd);
@@ -1458,28 +1451,8 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
        }
       howto = howto_table + r_type;
 
-      r_symndx = ELF32_R_SYM (rel->r_info);
-
-      if (info->relocateable)
-       {
-         /* This is a relocateable link.  We don't have to change
-            anything, unless the reloc is against a section symbol,
-            in which case we have to adjust according to where the
-            section symbol winds up in the output section.  */
-         if (r_symndx < symtab_hdr->sh_info)
-           {
-             sym = local_syms + r_symndx;
-             if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
-               {
-                 sec = local_sections[r_symndx];
-                 rel->r_addend += sec->output_offset + sym->st_value;
-               }
-           }
-
-         continue;
-       }
-
       /* This is a final link.  */
+      r_symndx = ELF32_R_SYM (rel->r_info);
       h = NULL;
       sym = NULL;
       sec = NULL;
@@ -1582,7 +1555,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
              {
                /* This is actually a static link, or it is a -Bsymbolic link
                   and the symbol is defined locally or there is no symbol.
-                  Change the GOT32 entry to a PC32 entry. */
+                  Change the GOT32 entry to a PC32 entry.  */
                break;
              }
 
@@ -1673,7 +1646,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
          got_offset = (plt_index + 3) * 4;
 
          /* We want the relocate to point into the .got.plt instead
-            of the plt itself. */
+            of the plt itself.  */
          relocation = (sgotplt->output_section->vma
                        + sgotplt->output_offset
                        + got_offset);
@@ -1809,7 +1782,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
                }
 
              if (!strcmp (bfd_get_section_name (input_bfd, input_section),
-                          ".text") != 0 || 
+                          ".text") != 0 ||
                  (info->shared
                   && ELF32_R_TYPE(outrel.r_info) != R_VAX_32
                   && ELF32_R_TYPE(outrel.r_info) != R_VAX_RELATIVE
@@ -2158,7 +2131,7 @@ elf_vax_finish_dynamic_sections (output_bfd, info)
                           + sgot->output_offset + 8
                           - (splt->output_section->vma + 12)),
                          splt->contents + 8);
-          elf_section_data (splt->output_section)->this_hdr.sh_entsize 
+          elf_section_data (splt->output_section)->this_hdr.sh_entsize
            = PLT_ENTRY_SIZE;
        }
     }
@@ -2216,5 +2189,6 @@ elf_vax_finish_dynamic_sections (output_bfd, info)
 #define elf_backend_plt_readonly       1
 #define elf_backend_want_plt_sym       0
 #define elf_backend_got_header_size    16
+#define elf_backend_rela_normal                1
 
 #include "elf32-target.h"
This page took 0.026415 seconds and 4 git commands to generate.