aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-06-11 20:23:58 +0000
committerIan Lance Taylor <ian@airs.com>1999-06-11 20:23:58 +0000
commit44257b8b9dc15f3328edf0fc4647384a9bb2336e (patch)
treea6389782035f4a78e0e79a5287962e65445214db
parent76171f81c775f93a83498d00d8c10c8b0fef9983 (diff)
downloadgdb-44257b8b9dc15f3328edf0fc4647384a9bb2336e.zip
gdb-44257b8b9dc15f3328edf0fc4647384a9bb2336e.tar.gz
gdb-44257b8b9dc15f3328edf0fc4647384a9bb2336e.tar.bz2
* reloc.c (_bfd_relocate_contents): Permit bitfield relocations to
wrap if the relocation covers the high bit of an address.
-rw-r--r--bfd/ChangeLog3
-rw-r--r--bfd/reloc.c9
2 files changed, 12 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e5edd46..0606b90 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,8 @@
1999-06-11 Ian Lance Taylor <ian@zembu.com>
+ * reloc.c (_bfd_relocate_contents): Permit bitfield relocations to
+ wrap if the relocation covers the high bit of an address.
+
* dwarf2.c (decode_line_info): Remove unused variable first_time.
1999-06-10 Jakub Jelinek <jj@ultra.linux.cz>
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 9e8735e..360c1b2 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -1560,6 +1560,15 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location)
/* We just assume (b & ~ fieldmask) == 0. */
+ /* We explicitly permit wrap around if this relocation
+ covers the high bit of an address. The Linux kernel
+ relies on it, and it is the only way to write assembler
+ code which can run when loaded at a location 0x80000000
+ away from the location at which it is linked. */
+ if (howto->bitsize + rightshift
+ == bfd_arch_bits_per_address (input_bfd))
+ break;
+
sum = a + b;
if (sum < a || (sum & ~ fieldmask) != 0)
{