aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1999-05-30 11:36:53 +0000
committerNick Clifton <nickc@redhat.com>1999-05-30 11:36:53 +0000
commit2ef994e0d61d9009407217c120112826b5d94fbc (patch)
tree5cbea0a917895316175199f6a637f261819efd10 /bfd
parent511ab9e95b69fddced78b9096afe745a5547f3c8 (diff)
downloadfsf-binutils-gdb-2ef994e0d61d9009407217c120112826b5d94fbc.zip
fsf-binutils-gdb-2ef994e0d61d9009407217c120112826b5d94fbc.tar.gz
fsf-binutils-gdb-2ef994e0d61d9009407217c120112826b5d94fbc.tar.bz2
Philip Blundell <philb@gnu.org>
* elf32-arm.h (elf32_arm_relocate_section): Reinstate change of 1993-03-25 (!!). Take into account the bitmasks for the reloc so the addend does not overflow into the rest of the word
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-arm.h10
2 files changed, 14 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 73d0c51..f69e51c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+1999-05-30 Philip Blundell <philb@gnu.org>
+
+ * elf32-arm.h (elf32_arm_relocate_section): Reinstate change of
+ 1993-03-25 (!!). Take into account the bitmasks for the reloc so
+ the addend does not overflow into the rest of the word.
+
1999-05-29 Nick Clifton <nickc@cygnus.com>
* bfd-in.h: Amend prototype for
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index 0cf2f9c..f7ef578 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -1631,8 +1631,14 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
#ifdef USE_REL
{
bfd_vma val;
- val = bfd_get_32 (input_bfd, contents + rel->r_offset);
- val += (sec->output_offset + sym->st_value);
+ bfd_vma insn;
+
+ insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ val = insn + ((sec->output_offset + sym->st_value)
+ >> howto->rightshift);
+ val &= howto->dst_mask;
+ val |= insn & ~(howto->dst_mask);
+
bfd_put_32 (input_bfd, val, contents + rel->r_offset);
}
#else