summaryrefslogtreecommitdiff
path: root/bfd/ihex.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-04-02 14:08:51 +0000
committerNick Clifton <nickc@redhat.com>2002-04-02 14:08:51 +0000
commitd6a7c3ec5b7250b86f937c29b60529a804b607fd (patch)
tree3f3c48ce00020e40be3900b866c9aa28289c3a24 /bfd/ihex.c
parent2852bb458c5e2a98b556da2e9dc08fe2da8ee5d3 (diff)
downloadbinutils-redhat-d6a7c3ec5b7250b86f937c29b60529a804b607fd.tar.gz
Do not allow records to cross a 64K boundary - wrap if necessary.
Diffstat (limited to 'bfd/ihex.c')
-rw-r--r--bfd/ihex.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/ihex.c b/bfd/ihex.c
index 0b02e6dee3..613eaf3b18 100644
--- a/bfd/ihex.c
+++ b/bfd/ihex.c
@@ -873,6 +873,11 @@ ihex_write_object_contents (abfd)
}
rec_addr = where - (extbase + segbase);
+
+ /* Output records shouldn't cross 64K boundaries. */
+ if (rec_addr + now > 0xfffff)
+ now = 0xffff - rec_addr;
+
if (! ihex_write_record (abfd, now, rec_addr, 0, p))
return false;