aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ip2k.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-ip2k.c')
-rw-r--r--bfd/elf32-ip2k.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index 42287f3..bd5375c 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -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;
+ /* 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 = 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