aboutsummaryrefslogtreecommitdiff
path: root/bfd
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
commit9e81ee671975bd958743c2a43bd78f75368214b1 (patch)
tree957c181de4b7f6393743fb5c184e952d972490a5 /bfd
parent5f44c186d76efda9c6cef2d39b404a0b3f88036d (diff)
downloadfsf-binutils-gdb-9e81ee671975bd958743c2a43bd78f75368214b1.zip
fsf-binutils-gdb-9e81ee671975bd958743c2a43bd78f75368214b1.tar.gz
fsf-binutils-gdb-9e81ee671975bd958743c2a43bd78f75368214b1.tar.bz2
Do not allow records to cross a 64K boundary - wrap if necessary.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/ihex.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d7f157c..1c335a1 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-02 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * ihex.c (ihex_write_object_contents): Do not allow records to
+ cross a 64K boundary - wrap if necessary.
+
2002-04-01 Nathan Williams <nathanw@wasabisystems.com>
* elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error
diff --git a/bfd/ihex.c b/bfd/ihex.c
index 0b02e6d..613eaf3 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;