summaryrefslogtreecommitdiff
path: root/bfd/elf32-h8300.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2002-07-23 12:29:33 +0000
committerAlan Modra <amodra@bigpond.net.au>2002-07-23 12:29:33 +0000
commit5930d48fa75015c2e932eff1001676480f46fb25 (patch)
tree7cf5da252a4cb0e76e19da10626afb866ba7aa03 /bfd/elf32-h8300.c
parentfe73d176f6fc8fe191f087529007b1abecdcf2b7 (diff)
downloadbinutils-redhat-5930d48fa75015c2e932eff1001676480f46fb25.tar.gz
* 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.
Diffstat (limited to 'bfd/elf32-h8300.c')
-rw-r--r--bfd/elf32-h8300.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index 0c7be53367..48e2960998 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -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