Do not allow records to cross a 64K boundary - wrap if necessary.
authorNick Clifton <nickc@redhat.com>
Tue, 2 Apr 2002 14:08:51 +0000 (14:08 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 2 Apr 2002 14:08:51 +0000 (14:08 +0000)
bfd/ChangeLog
bfd/ihex.c

index d7f157c..1c335a1 100644 (file)
@@ -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
index 0b02e6d..613eaf3 100644 (file)
@@ -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;