aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-11-19 02:19:39 +0000
committerAlan Modra <amodra@gmail.com>2007-11-19 02:19:39 +0000
commitcdfeee4f478cdd6961e4c208a0acc6d03e564eb0 (patch)
tree1d8b59e696e44a071cc2cf6ad72b6d56798dbec3 /bfd/elflink.c
parent8baca0f320428bee34a750dc917cdc22d221f1c8 (diff)
downloadgdb-cdfeee4f478cdd6961e4c208a0acc6d03e564eb0.zip
gdb-cdfeee4f478cdd6961e4c208a0acc6d03e564eb0.tar.gz
gdb-cdfeee4f478cdd6961e4c208a0acc6d03e564eb0.tar.bz2
* 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.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 084a6d2..63a8c65 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