aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-05-07 00:16:53 +0000
committerAlan Modra <amodra@gmail.com>2002-05-07 00:16:53 +0000
commitb491616acb5462a3694160ffef6413c160fed10a (patch)
tree2b9faccc50b1905a2a8a3d24e5e8e5c0b8f0ad0a /bfd/elf32-m32r.c
parentdaily update (diff)
downloadbinutils-gdb-b491616acb5462a3694160ffef6413c160fed10a.tar.gz
binutils-gdb-b491616acb5462a3694160ffef6413c160fed10a.tar.bz2
binutils-gdb-b491616acb5462a3694160ffef6413c160fed10a.zip
* 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-m32r.c')
-rw-r--r--bfd/elf32-m32r.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index b3b62204893..e8015a9b3c6 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -981,6 +981,11 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* Assume success. */
boolean ret = true;
+#ifndef USE_REL
+ if (info->relocateable)
+ return true;
+#endif
+
rel = relocs;
relend = relocs + input_section->reloc_count;
for (; rel < relend; rel++)
@@ -1020,6 +1025,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
howto = m32r_elf_howto_table + r_type;
r_symndx = ELF32_R_SYM (rel->r_info);
+#ifdef USE_REL
if (info->relocateable)
{
/* This is a relocateable link. We don't have to change
@@ -1045,16 +1051,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
sec = local_sections[r_symndx];
addend += sec->output_offset + sym->st_value;
-#ifndef USE_REL
- /* This can't be done for USE_REL because it doesn't mean anything
- and elf_link_input_bfd asserts this stays zero. */
- rel->r_addend = addend;
-#endif
-#ifndef USE_REL
- /* Addends are stored with relocs. We're done. */
- continue;
-#else /* USE_REL */
/* If partial_inplace, we need to store any additional addend
back in the section. */
if (! howto->partial_inplace)
@@ -1088,9 +1085,9 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
r = _bfd_relocate_contents (howto, input_bfd,
addend, contents + offset);
}
-#endif /* USE_REL */
}
else
+#endif /* USE_REL */
{
bfd_vma relocation;
@@ -2161,6 +2158,9 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
#define elf_backend_check_relocs m32r_elf_check_relocs
#define elf_backend_can_gc_sections 1
+#ifndef USE_REL
+#define elf_backend_rela_normal 1
+#endif
#if 0 /* not yet */
/* relax support */
#define bfd_elf32_bfd_relax_section m32r_elf_relax_section