* elf-hppa.h (elf_hppa_relocate_section): If relocatable, return
immediately. Remove code handling relocatable linking. * elf32-avr.c (elf32_avr_relocate_section): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. * elf32-fr30.c (elf32_frv_relocate_section): Likewise. * elf32-h8300.c (elf32_h8_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf32-v850.c (v850_elf_relocate_section): Likewise. * elf32-vax.c (elf_vax_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. * elf32-avr.c (elf_backend_rela_normal): Define. * elf32-cris.c: Likewise. * elf32-fr30.c: Likewise. * elf32-h8300.c: Likewise. * elf32-hppa.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-sparc.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf64-hppa.c: Likewise. * elf64-sparc.c: Likewise. * elf32-fr30.c (elf32_frv_relocate_section): Edit comment. * elf32-i860.c (elf32_i860_relocate_section): Likewise. * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. * elf-m10200.c (USE_RELA): Don't define. * elf-m10300.c: Likewise. * elf32-i370.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mcore.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-vax.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise. * elf32-avr.c (USE_REL): Don't undef. * elf32-ip2k.c: Likewise.
This commit is contained in:
parent
5e8d754953
commit
f0fe0e16e1
@ -1,3 +1,50 @@
|
||||
2002-07-23 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* elf-hppa.h (elf_hppa_relocate_section): If relocatable, return
|
||||
immediately. Remove code handling relocatable linking.
|
||||
* elf32-avr.c (elf32_avr_relocate_section): Likewise.
|
||||
* elf32-cris.c (cris_elf_relocate_section): Likewise.
|
||||
* elf32-fr30.c (elf32_frv_relocate_section): Likewise.
|
||||
* elf32-h8300.c (elf32_h8_relocate_section): Likewise.
|
||||
* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
|
||||
* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
|
||||
* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
|
||||
* elf32-v850.c (v850_elf_relocate_section): Likewise.
|
||||
* elf32-vax.c (elf_vax_relocate_section): Likewise.
|
||||
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
|
||||
* elf32-avr.c (elf_backend_rela_normal): Define.
|
||||
* elf32-cris.c: Likewise.
|
||||
* elf32-fr30.c: Likewise.
|
||||
* elf32-h8300.c: Likewise.
|
||||
* elf32-hppa.c: Likewise.
|
||||
* elf32-ip2k.c: Likewise.
|
||||
* elf32-sparc.c: Likewise.
|
||||
* elf32-v850.c: Likewise.
|
||||
* elf32-vax.c: Likewise.
|
||||
* elf64-hppa.c: Likewise.
|
||||
* elf64-sparc.c: Likewise.
|
||||
* elf32-fr30.c (elf32_frv_relocate_section): Edit comment.
|
||||
* elf32-i860.c (elf32_i860_relocate_section): Likewise.
|
||||
* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
|
||||
* elf32-m32r.c (m32r_elf_relocate_section): Likewise.
|
||||
* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
|
||||
* elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
|
||||
* elf-m10200.c (USE_RELA): Don't define.
|
||||
* elf-m10300.c: Likewise.
|
||||
* elf32-i370.c: Likewise.
|
||||
* elf32-ip2k.c: Likewise.
|
||||
* elf32-m68k.c: Likewise.
|
||||
* elf32-mcore.c: Likewise.
|
||||
* elf32-ppc.c: Likewise.
|
||||
* elf32-s390.c: Likewise.
|
||||
* elf32-vax.c: Likewise.
|
||||
* elf64-ppc.c: Likewise.
|
||||
* elf64-s390.c: Likewise.
|
||||
* elf64-x86-64.c: Likewise.
|
||||
* elfxx-ia64.c: Likewise.
|
||||
* elf32-avr.c (USE_REL): Don't undef.
|
||||
* elf32-ip2k.c: Likewise.
|
||||
|
||||
2002-07-23 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* elf-bfd.h (struct elf_backend_data): Add new bitfield
|
||||
|
@ -1376,8 +1376,12 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
Elf_Internal_Shdr *symtab_hdr;
|
||||
Elf_Internal_Rela *rel;
|
||||
Elf_Internal_Rela *relend;
|
||||
struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info);
|
||||
struct elf64_hppa_link_hash_table *hppa_info;
|
||||
|
||||
if (info->relocateable)
|
||||
return true;
|
||||
|
||||
hppa_info = elf64_hppa_hash_table (info);
|
||||
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
|
||||
|
||||
rel = relocs;
|
||||
@ -1405,28 +1409,8 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
return false;
|
||||
}
|
||||
|
||||
r_symndx = ELF_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)
|
||||
{
|
||||
sym_sec = local_sections[r_symndx];
|
||||
rel->r_addend += sym_sec->output_offset;
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/* This is a final link. */
|
||||
r_symndx = ELF_R_SYM (rel->r_info);
|
||||
h = NULL;
|
||||
sym = NULL;
|
||||
sym_sec = NULL;
|
||||
|
@ -45,10 +45,6 @@ static bfd_byte * mn10200_elf_get_relocated_section_contents
|
||||
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
|
||||
bfd_byte *, boolean, asymbol **));
|
||||
|
||||
/* We have to use RELA instructions since md_apply_fix3 in the assembler
|
||||
does absolutely nothing. */
|
||||
#define USE_RELA
|
||||
|
||||
enum reloc_type {
|
||||
R_MN10200_NONE = 0,
|
||||
R_MN10200_32,
|
||||
|
@ -134,10 +134,6 @@ static void compute_function_info
|
||||
PARAMS ((bfd *, struct elf32_mn10300_link_hash_entry *,
|
||||
bfd_vma, unsigned char *));
|
||||
|
||||
/* We have to use RELA instructions since md_apply_fix3 in the assembler
|
||||
does absolutely nothing. */
|
||||
#define USE_RELA
|
||||
|
||||
static reloc_howto_type elf_mn10300_howto_table[] = {
|
||||
/* Dummy relocation. Does nothing. */
|
||||
HOWTO (R_MN10300_NONE,
|
||||
|
@ -46,9 +46,6 @@ static boolean elf32_avr_relocate_section
|
||||
static void bfd_elf_avr_final_write_processing PARAMS ((bfd *, boolean));
|
||||
static boolean elf32_avr_object_p PARAMS ((bfd *));
|
||||
|
||||
/* Use RELA instead of REL */
|
||||
#undef USE_REL
|
||||
|
||||
static reloc_howto_type elf_avr_howto_table[] =
|
||||
{
|
||||
HOWTO (R_AVR_NONE, /* type */
|
||||
@ -722,6 +719,9 @@ elf32_avr_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
Elf_Internal_Rela * rel;
|
||||
Elf_Internal_Rela * relend;
|
||||
|
||||
if (info->relocateable)
|
||||
return true;
|
||||
|
||||
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
|
||||
sym_hashes = elf_sym_hashes (input_bfd);
|
||||
relend = relocs + input_section->reloc_count;
|
||||
@ -738,30 +738,9 @@ elf32_avr_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
const char * name = NULL;
|
||||
int r_type;
|
||||
|
||||
/* This is a final link. */
|
||||
r_type = ELF32_R_TYPE (rel->r_info);
|
||||
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. */
|
||||
howto = elf_avr_howto_table + ELF32_R_TYPE (rel->r_info);
|
||||
h = NULL;
|
||||
sym = NULL;
|
||||
@ -952,6 +931,7 @@ elf32_avr_object_p (abfd)
|
||||
#define elf_backend_gc_sweep_hook elf32_avr_gc_sweep_hook
|
||||
#define elf_backend_check_relocs elf32_avr_check_relocs
|
||||
#define elf_backend_can_gc_sections 1
|
||||
#define elf_backend_rela_normal 1
|
||||
#define elf_backend_final_write_processing \
|
||||
bfd_elf_avr_final_write_processing
|
||||
#define elf_backend_object_p elf32_avr_object_p
|
||||
|
@ -799,6 +799,9 @@ cris_elf_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;
|
||||
local_got_offsets = elf_local_got_offsets (input_bfd);
|
||||
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
|
||||
@ -833,29 +836,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| r_type == R_CRIS_GNU_VTENTRY)
|
||||
continue;
|
||||
|
||||
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);
|
||||
howto = cris_elf_howto_table + r_type;
|
||||
h = NULL;
|
||||
sym = NULL;
|
||||
@ -3113,6 +3095,7 @@ elf_cris_reloc_type_class (rela)
|
||||
take the easy route. */
|
||||
#define elf_backend_may_use_rel_p 0
|
||||
#define elf_backend_may_use_rela_p 1
|
||||
#define elf_backend_rela_normal 1
|
||||
|
||||
#include "elf32-target.h"
|
||||
|
||||
|
@ -468,9 +468,6 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
|
||||
}
|
||||
|
||||
/* Relocate an FR30 ELF section.
|
||||
There is some attempt to make this function usable for many architectures,
|
||||
both USE_REL and USE_RELA ['twould be nice if such a critter existed],
|
||||
if only to serve as a learning tool.
|
||||
|
||||
The RELOCATE_SECTION function is called by the new ELF backend linker
|
||||
to handle the relocations for a section.
|
||||
|
@ -429,6 +429,9 @@ elf32_h8_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
struct elf_link_hash_entry **sym_hashes;
|
||||
Elf_Internal_Rela *rel, *relend;
|
||||
|
||||
if (info->relocateable)
|
||||
return true;
|
||||
|
||||
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
|
||||
sym_hashes = elf_sym_hashes (input_bfd);
|
||||
|
||||
@ -444,29 +447,9 @@ elf32_h8_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
bfd_vma relocation;
|
||||
bfd_reloc_status_type r;
|
||||
|
||||
/* This is a final link. */
|
||||
r_symndx = ELF32_R_SYM (rel->r_info);
|
||||
r_type = ELF32_R_TYPE (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. */
|
||||
h = NULL;
|
||||
sym = NULL;
|
||||
sec = NULL;
|
||||
@ -1465,6 +1448,7 @@ elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order,
|
||||
|
||||
/* Use an H8 specific linker, not the ELF generic linker. */
|
||||
#define elf_backend_relocate_section elf32_h8_relocate_section
|
||||
#define elf_backend_rela_normal 1
|
||||
|
||||
/* And relaxing stuff. */
|
||||
#define bfd_elf32_bfd_relax_section elf32_h8_relax_section
|
||||
|
@ -3610,6 +3610,9 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
Elf_Internal_Rela *rel;
|
||||
Elf_Internal_Rela *relend;
|
||||
|
||||
if (info->relocateable)
|
||||
return true;
|
||||
|
||||
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
|
||||
|
||||
htab = hppa_link_hash_table (info);
|
||||
@ -3641,27 +3644,8 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| r_type == (unsigned int) R_PARISC_GNU_VTINHERIT)
|
||||
continue;
|
||||
|
||||
r_symndx = ELF32_R_SYM (rel->r_info);
|
||||
|
||||
if (info->relocateable)
|
||||
{
|
||||
/* This is a relocatable 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)
|
||||
{
|
||||
sym_sec = local_sections[r_symndx];
|
||||
rel->r_addend += sym_sec->output_offset;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* This is a final link. */
|
||||
r_symndx = ELF32_R_SYM (rel->r_info);
|
||||
h = NULL;
|
||||
sym = NULL;
|
||||
sym_sec = NULL;
|
||||
@ -4469,6 +4453,7 @@ elf32_hppa_elf_get_symbol_type (elf_sym, type)
|
||||
#define elf_backend_plt_readonly 0
|
||||
#define elf_backend_want_plt_sym 0
|
||||
#define elf_backend_got_header_size 8
|
||||
#define elf_backend_rela_normal 1
|
||||
|
||||
#define TARGET_BIG_SYM bfd_elf32_hppa_vec
|
||||
#define TARGET_BIG_NAME "elf32-hppa"
|
||||
|
@ -34,8 +34,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "elf-bfd.h"
|
||||
#include "elf/i370.h"
|
||||
|
||||
#define USE_RELA /* we want RELA relocations, not REL */
|
||||
|
||||
/* i370 relocations */
|
||||
/* Note that there is really just one relocation that we currently
|
||||
* support (and only one that we seem to need, at the moment), and
|
||||
|
@ -831,9 +831,6 @@ i860_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
|
||||
/* Relocate an i860 ELF section.
|
||||
|
||||
This is boiler-plate code copied from fr30.
|
||||
There is some attempt to make this function usable for many architectures,
|
||||
both USE_REL and USE_RELA ['twould be nice if such a critter existed],
|
||||
if only to serve as a learning tool.
|
||||
|
||||
The RELOCATE_SECTION function is called by the new ELF backend linker
|
||||
to handle the relocations for a section.
|
||||
|
@ -1711,9 +1711,6 @@ ip2k_final_link_relocate (howto, input_bfd, input_section, contents, rel,
|
||||
}
|
||||
|
||||
/* Relocate a IP2K ELF section.
|
||||
There is some attempt to make this function usable for many architectures,
|
||||
both USE_REL and USE_RELA ['twould be nice if such a critter existed],
|
||||
if only to serve as a learning tool.
|
||||
|
||||
The RELOCATE_SECTION function is called by the new ELF backend linker
|
||||
to handle the relocations for a section.
|
||||
@ -1760,6 +1757,9 @@ ip2k_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
Elf_Internal_Rela * rel;
|
||||
Elf_Internal_Rela * relend;
|
||||
|
||||
if (info->relocateable)
|
||||
return true;
|
||||
|
||||
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
|
||||
sym_hashes = elf_sym_hashes (input_bfd);
|
||||
relend = relocs + input_section->reloc_count;
|
||||
@ -1776,31 +1776,9 @@ ip2k_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
const char * name = NULL;
|
||||
int r_type;
|
||||
|
||||
r_type = ELF32_R_TYPE (rel->r_info);
|
||||
|
||||
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_type = ELF32_R_TYPE (rel->r_info);
|
||||
r_symndx = ELF32_R_SYM (rel->r_info);
|
||||
howto = ip2k_elf_howto_table + ELF32_R_TYPE (rel->r_info);
|
||||
h = NULL;
|
||||
sym = NULL;
|
||||
@ -1968,13 +1946,11 @@ ip2k_elf_gc_sweep_hook (abfd, info, sec, relocs)
|
||||
#define ELF_MACHINE_CODE EM_IP2K
|
||||
#define ELF_MAXPAGESIZE 1 /* No pages on the IP2K */
|
||||
|
||||
#undef USE_REL
|
||||
#define USE_RELA
|
||||
|
||||
#define elf_info_to_howto_rel NULL
|
||||
#define elf_info_to_howto ip2k_info_to_howto_rela
|
||||
|
||||
#define elf_backend_can_gc_sections 1
|
||||
#define elf_backend_rela_normal 1
|
||||
#define elf_backend_gc_mark_hook ip2k_elf_gc_mark_hook
|
||||
#define elf_backend_gc_sweep_hook ip2k_elf_gc_sweep_hook
|
||||
|
||||
|
@ -931,8 +931,7 @@ m32r_elf_final_sda_base (output_bfd, info, error_message, psb)
|
||||
|
||||
/* Relocate an M32R/D ELF section.
|
||||
There is some attempt to make this function usable for many architectures,
|
||||
both USE_REL and USE_RELA ['twould be nice if such a critter existed],
|
||||
if only to serve as a learning tool.
|
||||
both for RELA and REL type relocs, if only to serve as a learning tool.
|
||||
|
||||
The RELOCATE_SECTION function is called by the new ELF backend linker
|
||||
to handle the relocations for a section.
|
||||
|
@ -180,8 +180,6 @@ reloc_type_lookup (abfd, code)
|
||||
#define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup
|
||||
#define ELF_ARCH bfd_arch_m68k
|
||||
/* end code generated by elf.el */
|
||||
|
||||
#define USE_RELA
|
||||
|
||||
/* Functions for the m68k ELF linker. */
|
||||
|
||||
|
@ -29,8 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "elf/mcore.h"
|
||||
#include <assert.h>
|
||||
|
||||
#define USE_RELA /* Only USE_REL is actually significant, but this is
|
||||
here are a reminder... */
|
||||
/* RELA relocs are used here... */
|
||||
|
||||
static void mcore_elf_howto_init
|
||||
PARAMS ((void));
|
||||
|
@ -289,9 +289,6 @@ openrisc_final_link_relocate (howto, input_bfd, input_section, contents, rel,
|
||||
}
|
||||
|
||||
/* Relocate an OpenRISC ELF section.
|
||||
There is some attempt to make this function usable for many architectures,
|
||||
both USE_REL and USE_RELA ['twould be nice if such a critter existed],
|
||||
if only to serve as a learning tool.
|
||||
|
||||
The RELOCATE_SECTION function is called by the new ELF backend linker
|
||||
to handle the relocations for a section.
|
||||
|
@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "elf-bfd.h"
|
||||
#include "elf/ppc.h"
|
||||
|
||||
#define USE_RELA /* we want RELA relocations, not REL */
|
||||
/* RELA relocations are used here. */
|
||||
|
||||
static reloc_howto_type *ppc_elf_reloc_type_lookup
|
||||
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
|
||||
|
@ -71,8 +71,6 @@ static boolean elf_s390_finish_dynamic_sections
|
||||
static boolean elf_s390_object_p PARAMS ((bfd *));
|
||||
static boolean elf_s390_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *));
|
||||
|
||||
#define USE_RELA 1 /* We want RELA relocations, not REL. */
|
||||
|
||||
#include "elf/s390.h"
|
||||
|
||||
/* The relocation "howto" table. */
|
||||
|
@ -1117,6 +1117,9 @@ elf32_sparc_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);
|
||||
@ -1159,28 +1162,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
}
|
||||
howto = _bfd_sparc_elf_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;
|
||||
@ -2147,5 +2130,6 @@ elf32_sparc_reloc_type_class (rela)
|
||||
#define elf_backend_want_plt_sym 1
|
||||
#define elf_backend_got_header_size 4
|
||||
#define elf_backend_plt_header_size (4*PLT_ENTRY_SIZE)
|
||||
#define elf_backend_rela_normal 1
|
||||
|
||||
#include "elf32-target.h"
|
||||
|
@ -1529,6 +1529,9 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
Elf_Internal_Rela * rel;
|
||||
Elf_Internal_Rela * relend;
|
||||
|
||||
if (info->relocateable)
|
||||
return true;
|
||||
|
||||
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
|
||||
sym_hashes = elf_sym_hashes (input_bfd);
|
||||
|
||||
@ -1566,28 +1569,8 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| r_type == R_V850_GNU_VTINHERIT)
|
||||
continue;
|
||||
|
||||
howto = v850_elf_howto_table + r_type;
|
||||
|
||||
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. */
|
||||
howto = v850_elf_howto_table + r_type;
|
||||
h = NULL;
|
||||
sym = NULL;
|
||||
sec = NULL;
|
||||
@ -2208,6 +2191,7 @@ v850_elf_fake_sections (abfd, hdr, sec)
|
||||
#define elf_backend_gc_sweep_hook v850_elf_gc_sweep_hook
|
||||
|
||||
#define elf_backend_can_gc_sections 1
|
||||
#define elf_backend_rela_normal 1
|
||||
|
||||
#define bfd_elf32_bfd_is_local_label_name v850_elf_is_local_label_name
|
||||
#define bfd_elf32_bfd_reloc_type_lookup v850_elf_reloc_type_lookup
|
||||
|
@ -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
|
||||
|
||||
/* Functions for the VAX ELF linker. */
|
||||
|
||||
@ -1419,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);
|
||||
@ -1450,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;
|
||||
@ -2208,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"
|
||||
|
@ -709,9 +709,6 @@ xstormy16_elf_always_size_sections (output_bfd, info)
|
||||
}
|
||||
|
||||
/* Relocate an XSTORMY16 ELF section.
|
||||
There is some attempt to make this function usable for many architectures,
|
||||
both USE_REL and USE_RELA ['twould be nice if such a critter existed],
|
||||
if only to serve as a learning tool.
|
||||
|
||||
The RELOCATE_SECTION function is called by the new ELF backend linker
|
||||
to handle the relocations for a section.
|
||||
|
@ -2724,7 +2724,7 @@ const struct elf_size_info hppa64_elf_size_info =
|
||||
#define elf_backend_fake_sections elf_hppa_fake_sections
|
||||
#define elf_backend_add_symbol_hook elf_hppa_add_symbol_hook
|
||||
|
||||
#define elf_backend_relocate_section elf_hppa_relocate_section
|
||||
#define elf_backend_relocate_section elf_hppa_relocate_section
|
||||
|
||||
#define bfd_elf64_bfd_final_link elf_hppa_final_link
|
||||
|
||||
@ -2770,6 +2770,7 @@ const struct elf_size_info hppa64_elf_size_info =
|
||||
#define elf_backend_type_change_ok true
|
||||
#define elf_backend_get_symbol_type elf64_hppa_elf_get_symbol_type
|
||||
#define elf_backend_reloc_type_class elf64_hppa_reloc_type_class
|
||||
#define elf_backend_rela_normal 1
|
||||
|
||||
#include "elf64-target.h"
|
||||
|
||||
|
@ -30,9 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "elf/ppc.h"
|
||||
#include "elf64-ppc.h"
|
||||
|
||||
#define USE_RELA /* we want RELA relocations, not REL. */
|
||||
|
||||
|
||||
static void ppc_howto_init
|
||||
PARAMS ((void));
|
||||
static reloc_howto_type *ppc64_elf_reloc_type_lookup
|
||||
|
@ -70,8 +70,6 @@ static boolean elf_s390_finish_dynamic_sections
|
||||
PARAMS ((bfd *, struct bfd_link_info *));
|
||||
static boolean elf_s390_object_p PARAMS ((bfd *));
|
||||
|
||||
#define USE_RELA 1 /* We want RELA relocations, not REL. */
|
||||
|
||||
#include "elf/s390.h"
|
||||
|
||||
/* In case we're on a 32-bit machine, construct a 64-bit "-1" value
|
||||
|
@ -1919,6 +1919,9 @@ sparc64_elf_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);
|
||||
@ -1954,28 +1957,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
}
|
||||
howto = sparc64_elf_howto_table + r_type;
|
||||
|
||||
r_symndx = ELF64_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 = ELF64_R_SYM (rel->r_info);
|
||||
h = NULL;
|
||||
sym = NULL;
|
||||
sec = NULL;
|
||||
@ -3171,6 +3154,7 @@ const struct elf_size_info sparc64_elf_size_info =
|
||||
#define elf_backend_want_got_plt 0
|
||||
#define elf_backend_plt_readonly 0
|
||||
#define elf_backend_want_plt_sym 1
|
||||
#define elf_backend_rela_normal 1
|
||||
|
||||
/* Section 5.2.4 of the ABI specifies a 256-byte boundary for the table. */
|
||||
#define elf_backend_plt_alignment 8
|
||||
|
@ -26,9 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "elf/x86-64.h"
|
||||
|
||||
/* We use only the RELA entries. */
|
||||
#define USE_RELA 1
|
||||
|
||||
/* In case we're on a 32-bit machine, construct a 64-bit "-1" value. */
|
||||
#define MINUS_ONE (~ (bfd_vma) 0)
|
||||
|
||||
|
@ -53,8 +53,6 @@
|
||||
MIN_PLT Created by PLTOFF entries against dynamic symbols. This
|
||||
does not reqire dynamic relocations. */
|
||||
|
||||
#define USE_RELA /* we want RELA relocs, not REL */
|
||||
|
||||
#define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0])))
|
||||
|
||||
typedef struct bfd_hash_entry *(*new_hash_entry_func)
|
||||
|
Loading…
x
Reference in New Issue
Block a user