From: Nick Clifton Date: Tue, 2 Apr 2002 14:08:51 +0000 (+0000) Subject: Do not allow records to cross a 64K boundary - wrap if necessary. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9e81ee671975bd958743c2a43bd78f75368214b1;p=binutils-gdb.git Do not allow records to cross a 64K boundary - wrap if necessary. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d7f157c1440..1c335a1f321 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-04-02 Nick Clifton + + * ihex.c (ihex_write_object_contents): Do not allow records to + cross a 64K boundary - wrap if necessary. + 2002-04-01 Nathan Williams * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error 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;