aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-02-03 16:54:36 +0000
committerIan Lance Taylor <ian@airs.com>1997-02-03 16:54:36 +0000
commitbcb686ca093cb2d6a0e9496d108f2328cc65acd2 (patch)
tree4cc3cb1a39701271e3376668ca6ee9f4f268fb9b
parent0d8017baade73f0b3f2681bc52909610f957fa3a (diff)
downloadgdb-bcb686ca093cb2d6a0e9496d108f2328cc65acd2.zip
gdb-bcb686ca093cb2d6a0e9496d108f2328cc65acd2.tar.gz
gdb-bcb686ca093cb2d6a0e9496d108f2328cc65acd2.tar.bz2
* coff-h8300.c (h8300_reloc16_extra_cases): Correct off by one
error in overflow check for R_RELBYTE. PR 11591.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/coff-h8300.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5adfad3..3b87aab 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+Mon Feb 3 11:54:06 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-h8300.c (h8300_reloc16_extra_cases): Correct off by one
+ error in overflow check for R_RELBYTE.
+
Fri Jan 31 14:07:27 1997 Ian Lance Taylor <ian@cygnus.com>
* ieee.c (ieee_slurp_section_data): Pick up the start address.
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index dc467f9..6e7ba387 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -733,7 +733,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
/* Sanity check. */
- if (value < 0xff
+ if (value <= 0xff
|| (value >= 0x0000ff00 && value <= 0x0000ffff)
|| (value >= 0x00ffff00 && value <= 0x00ffffff)
|| (value >= 0xffffff00 && value <= 0xffffffff))
@@ -741,7 +741,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
/* Everything looks OK. Apply the relocation and update the
src/dst address appropriately. */
- bfd_put_8 (abfd, gap, data + dst_address);
+ bfd_put_8 (abfd, value & 0xff, data + dst_address);
dst_address += 1;
src_address += 1;
}