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
commit1a0a768be069977423d7d8f3dd6fd830c6c28eb5 (patch)
tree8c570b8b7b4939b0b35bff0878e4d39b3262782c /bfd/ihex.c
parente3951c82c077a678c759facec04b786886427a24 (diff)
downloadgdb-1a0a768be069977423d7d8f3dd6fd830c6c28eb5.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 0b02e6dee33..613eaf3b189 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;