elf: Strip zero-sized dynamic sections
[deliverable/binutils-gdb.git] / bfd / ihex.c
index 68671cc6239357ec76088eccf87cb11f6e5227ff..ca36043fe2daf48d8e7c68249f1df2311cdb9f37 100644 (file)
@@ -811,16 +811,15 @@ ihex_write_object_contents (bfd *abfd)
          if (count > CHUNK)
            now = CHUNK;
 
-         if (where > segbase + extbase + 0xffff)
+         if (where < extbase
+             || where - extbase < segbase
+             || where - extbase - segbase > 0xffff)
            {
              bfd_byte addr[2];
 
              /* We need a new base address.  */
-             if (where <= 0xfffff)
+             if (extbase == 0 && where <= 0xfffff)
                {
-                 /* The addresses should be sorted.  */
-                 BFD_ASSERT (extbase == 0);
-
                  segbase = where & 0xf0000;
                  addr[0] = (bfd_byte)(segbase >> 12) & 0xff;
                  addr[1] = (bfd_byte)(segbase >> 4) & 0xff;
This page took 0.023194 seconds and 4 git commands to generate.