summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2007-11-19 02:19:39 +0000
committerAlan Modra <amodra@bigpond.net.au>2007-11-19 02:19:39 +0000
commitbee1601d9928e4eaf0469a30cae4df7b432864b5 (patch)
tree3f5be0491b8cbdea258bdb790097d1e3bcdc5df9
parent8769ec1c7ded739422d8770cdca1d35bae1ebfdf (diff)
downloadbinutils-redhat-bee1601d9928e4eaf0469a30cae4df7b432864b5.tar.gz
* elf-bfd.h (bfd_elf_perform_complex_relocation): Update prototype.
* elflink.c (bfd_elf_perform_complex_relocation): Return status. Don't print reloc overflow message. * elf32-mep.c (mep_elf_relocate_section): Handle status from bfd_elf_perform_complex_relocation.
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elf-bfd.h2
-rw-r--r--bfd/elf32-mep.c18
-rw-r--r--bfd/elflink.c26
4 files changed, 26 insertions, 28 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index abdf1153eb..f85cf928ad 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2007-11-19 Alan Modra <amodra@bigpond.net.au>
+
+ * elf-bfd.h (bfd_elf_perform_complex_relocation): Update prototype.
+ * elflink.c (bfd_elf_perform_complex_relocation): Return status.
+ Don't print reloc overflow message.
+ * elf32-mep.c (mep_elf_relocate_section): Handle status from
+ bfd_elf_perform_complex_relocation.
+
2007-11-17 Thiemo Seufer <ths@mips.com>
* elfxx-mips.c (mips_elf_merge_obj_attributes): Handle -mips32r2
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 6afd9d198d..35fb78eaf9 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1814,7 +1814,7 @@ extern bfd_boolean _bfd_elf_dynamic_symbol_p
extern bfd_boolean _bfd_elf_symbol_refs_local_p
(struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean);
-extern void bfd_elf_perform_complex_relocation
+extern bfd_reloc_status_type bfd_elf_perform_complex_relocation
(bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma);
extern bfd_boolean _bfd_elf_setup_sections
diff --git a/bfd/elf32-mep.c b/bfd/elf32-mep.c
index e5d33caa5c..783961743d 100644
--- a/bfd/elf32-mep.c
+++ b/bfd/elf32-mep.c
@@ -513,18 +513,12 @@ mep_elf_relocate_section
if (info->relocatable)
continue;
- switch (r_type)
- {
- case R_RELC:
- bfd_elf_perform_complex_relocation (input_bfd, input_section,
- contents, rel, relocation);
- continue;
-
- default:
- r = mep_final_link_relocate (howto, input_bfd, input_section,
- contents, rel, relocation);
- break;
- }
+ if (r_type == R_RELC)
+ r = bfd_elf_perform_complex_relocation (input_bfd, input_section,
+ contents, rel, relocation);
+ else
+ r = mep_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel, relocation);
if (r != bfd_reloc_ok)
{
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 084a6d2d39..63a8c6592d 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -7646,15 +7646,16 @@ decode_complex_addend (unsigned long *start, /* in bits */
* trunc_p = (encoded >> 29) & 1;
}
-void
+bfd_reloc_status_type
bfd_elf_perform_complex_relocation (bfd *input_bfd,
- asection *input_section,
+ asection *input_section ATTRIBUTE_UNUSED,
bfd_byte *contents,
Elf_Internal_Rela *rel,
bfd_vma relocation)
{
bfd_vma shift, x, mask;
unsigned long start, oplen, len, wordsz, chunksz, lsb0_p, signed_p, trunc_p;
+ bfd_reloc_status_type r;
/* Perform this reloc, since it is complex.
(this is not to say that it necessarily refers to a complex
@@ -7684,20 +7685,14 @@ bfd_elf_perform_complex_relocation (bfd *input_bfd,
oplen, x, mask, relocation);
#endif
+ r = bfd_reloc_ok;
if (! trunc_p)
- {
- /* Now do an overflow check. */
- if (bfd_check_overflow ((signed_p
- ? complain_overflow_signed
- : complain_overflow_unsigned),
- len, 0, (8 * wordsz),
- relocation) == bfd_reloc_overflow)
- (*_bfd_error_handler)
- ("%s (%s + 0x%lx): relocation overflow: 0x%lx %sdoes not fit "
- "within 0x%lx",
- input_bfd->filename, input_section->name, rel->r_offset,
- relocation, (signed_p ? "(signed) " : ""), mask);
- }
+ /* Now do an overflow check. */
+ r = bfd_check_overflow ((signed_p
+ ? complain_overflow_signed
+ : complain_overflow_unsigned),
+ len, 0, (8 * wordsz),
+ relocation);
/* Do the deed. */
x = (x & ~(mask << shift)) | ((relocation & mask) << shift);
@@ -7711,6 +7706,7 @@ bfd_elf_perform_complex_relocation (bfd *input_bfd,
((relocation & mask) << shift), x);
#endif
put_value (wordsz, chunksz, input_bfd, x, contents + rel->r_offset);
+ return r;
}
/* When performing a relocatable link, the input relocations are