diff options
author | Alan Modra <amodra@gmail.com> | 2002-05-07 00:16:53 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-05-07 00:16:53 +0000 |
commit | b491616acb5462a3694160ffef6413c160fed10a (patch) | |
tree | 2b9faccc50b1905a2a8a3d24e5e8e5c0b8f0ad0a /bfd/elf32-mcore.c | |
parent | 862eabf1fb427b15a156ce7fc2870dd9351c3509 (diff) | |
download | binutils-gdb-b491616acb5462a3694160ffef6413c160fed10a.tar.gz |
* elf-bfd.h (struct elf_backend_data): Add rela_normal.
* elfxx-target.h (elf_backend_rela_normal): Define.
(elfNN_bed): Init rela_normal.
* elflink.h (elf_link_input_bfd <emit_relocs>): Handle adjustment
for section symbols here if rela_normal. Simplify abs section test.
* elf-m10200.c (mn10200_elf_relocate_section): If relocatable,
return immediately. Remove code handling relocatable linking.
* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
* elf32-fr30.c (fr30_elf_relocate_section): Likewise.
* elf32-i370.c (i370_elf_relocate_section): Likewise.
* elf32-i860.c (elf32_i860_relocate_section): Likewise.
* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
* elf32-s390.c (elf_s390_relocate_section): Likewise.
* elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
* elf64-s390.c (elf_s390_relocate_section): Likewise.
* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
* elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
* elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL.
* elf32-m32r.c (m32r_elf_relocate_section): Likewise.
* elf-m10200.c (elf_backend_rela_normal): Define.
* elf-m10300.c (elf_backend_rela_normal): Define.
* elf32-fr30.c (elf_backend_rela_normal): Define.
* elf32-i370.c (elf_backend_rela_normal): Define.
* elf32-i860.c (elf_backend_rela_normal): Define.
* elf32-m68k.c (elf_backend_rela_normal): Define.
* elf32-mcore.c (elf_backend_rela_normal): Define.
* elf32-openrisc.c (elf_backend_rela_normal): Define.
* elf32-ppc.c (elf_backend_rela_normal): Define.
* elf32-s390.c (elf_backend_rela_normal): Define.
* elf32-xstormy16.c (elf_backend_rela_normal): Define.
* elf64-ppc.c (elf_backend_rela_normal): Define.
* elf64-s390.c (elf_backend_rela_normal): Define.
* elf64-x86-64.c (elf_backend_rela_normal): Define.
* elfxx-ia64.c (elf_backend_rela_normal): Define.
* elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL.
* elf32-m32r.c (elf_backend_rela_normal): Likewise.
Diffstat (limited to 'bfd/elf32-mcore.c')
-rw-r--r-- | bfd/elf32-mcore.c | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c index a0784f6b0d0..38e9c13d13c 100644 --- a/bfd/elf32-mcore.c +++ b/bfd/elf32-mcore.c @@ -1,5 +1,6 @@ /* Motorola MCore specific support for 32-bit ELF - Copyright 1994, 1995, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1994, 1995, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -414,6 +415,9 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, (info->relocateable) ? " (relocatable)" : ""); #endif + if (info->relocateable) + return true; + if (! mcore_elf_howto_table [R_MCORE_PCRELIMM8BY4]) /* Initialize howto table if needed */ mcore_elf_howto_init (); @@ -447,32 +451,6 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, howto = mcore_elf_howto_table [(int) 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 ((unsigned)ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - addend = rel->r_addend += sec->output_offset + sym->st_value; - } - } - -#ifdef DEBUG - fprintf (stderr, "\ttype = %s (%d), symbol index = %ld, offset = %ld, addend = %ld\n", - howto->name, (int) r_type, r_symndx, (long) offset, (long) addend); -#endif - continue; - } - - /* This is a final link. */ - /* Complain about known relocation that are not yet supported. */ if (howto->special_function == mcore_elf_unsupported_reloc) { @@ -726,5 +704,6 @@ mcore_elf_check_relocs (abfd, info, sec, relocs) #define elf_backend_check_relocs mcore_elf_check_relocs #define elf_backend_can_gc_sections 1 +#define elf_backend_rela_normal 1 #include "elf32-target.h" |