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 *,
#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. */
/* 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);
bfd_get_filename (abfd), rel->r_addend,
h->root.root.string,
eh->got_addend);
-
+
}
}
break;
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;
}
}
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;
}
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);
}
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;
{
/* 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;
}
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);
}
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
+ 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;
}
}
#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"