bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IHEX: Do not allow records to cross a 64K boundary


From: Nick Clifton
Subject: IHEX: Do not allow records to cross a 64K boundary
Date: 02 Apr 2002 15:11:15 +0100

Hi Guys,

  I am applying the patch below, developed by Graham Stott, to fix a
  bug in the IHEX implementation.  The IHEX standard says that records
  should not cross a 64K boundary - instead they should wrap around to
  the start of the section.

Cheers
        Nick

2002-04-02  Nick Clifton  <address@hidden>

        * ihex.c (ihex_write_object_contents): Do not allow records to
        cross a 64K boundary - wrap if necessary.

Index: bfd/ihex.c
===================================================================
RCS file: /cvs/src/src/bfd/ihex.c,v
retrieving revision 1.11
diff -c -3 -p -w -r1.11 ihex.c
*** ihex.c      2002/01/30 16:07:28     1.11
--- ihex.c      2002/04/02 14:06:20
*************** ihex_write_object_contents (abfd)
*** 873,878 ****
--- 873,883 ----
            }
  
          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;
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]