]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix code to prevent records crossing a 64K boundary
authorNick Clifton <nickc@redhat.com>
Wed, 17 Apr 2002 07:27:26 +0000 (07:27 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 17 Apr 2002 07:27:26 +0000 (07:27 +0000)
bfd/ChangeLog
bfd/ihex.c

index f58ffce6fe4c0c78f899a930982fac2b1baa0c7f..233927e01fdf90ce999ccdb4c2b10076252ac860 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-16  Nick Clifton  <nickc@cambridge.redhat.com>
+
+       * ihex.c (ihex_write_object_contents): Fix check for records
+       crossing 64K boundaries.
+
 2002-04-06  Hans-Peter Nilsson  <hp@axis.com>
 
        * elf32-cris.c (cris_elf_howto_table) <R_CRIS_16_PCREL,
index 613eaf3b189fdd75aacbb049699f11178884e353..2e4494d13039d7d9a186cc339954d9aa5fb1f461 100644 (file)
@@ -875,8 +875,8 @@ 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 (rec_addr + now > 0xffff)
+            now = 0x10000 - rec_addr;
 
          if (! ihex_write_record (abfd, now, rec_addr, 0, p))
            return false;