aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorDaniel Gutson <dgutson@codesourcery.com>2009-12-28 18:55:16 +0000
committerDaniel Gutson <dgutson@codesourcery.com>2009-12-28 18:55:16 +0000
commit4e67d4ca2a172339a5899ae47a065e61d1a13e69 (patch)
tree4bab1100507b771ba76b33fecc7e51c0df2e98dc /bfd
parent2598a05c7be4d36b9cf79d066de0dd6fd8ba3247 (diff)
downloadgdb-4e67d4ca2a172339a5899ae47a065e61d1a13e69.zip
gdb-4e67d4ca2a172339a5899ae47a065e61d1a13e69.tar.gz
gdb-4e67d4ca2a172339a5899ae47a065e61d1a13e69.tar.bz2
bfd/
* elf32-arm.c (elf32_arm_final_link_relocate): limits fixed. ld/testsuite/ * ld-arm/arm-elf.exp (armelftests): New test case added. * ld-arm/reloc-boundaries.s: New file. * ld-arm/reloc-boundaries.d: New file.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-arm.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6ccebdc..bce7915 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2009-12-28 Daniel Gutson <dgutson@codesourcery.com>
+ * elf32-arm.c (elf32_arm_final_link_relocate): limits
+ fixed.
+
+2009-12-28 Daniel Gutson <dgutson@codesourcery.com>
+
* elf-attrs.c (_bfd_elf_merge_object_attributes): Error
message rephrased.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 1921780..3e9759b 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -7212,7 +7212,11 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
case R_ARM_ABS8:
value += addend;
- if ((long) value > 0x7f || (long) value < -0x80)
+
+ /* There is no way to tell whether the user intended to use a signed or
+ unsigned addend. When checking for overflow we accept either,
+ as specified by the AAELF. */
+ if ((long) value > 0xff || (long) value < -0x80)
return bfd_reloc_overflow;
bfd_put_8 (input_bfd, value, hit_data);
@@ -7221,7 +7225,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
case R_ARM_ABS16:
value += addend;
- if ((long) value > 0x7fff || (long) value < -0x8000)
+ /* See comment for R_ARM_ABS8. */
+ if ((long) value > 0xffff || (long) value < -0x8000)
return bfd_reloc_overflow;
bfd_put_16 (input_bfd, value, hit_data);