X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=bfd%2Fihex.c;h=ca36043fe2daf48d8e7c68249f1df2311cdb9f37;hb=6f6fd151cbf226bbaa66e44977f57b7c6dc33d89;hp=68671cc6239357ec76088eccf87cb11f6e5227ff;hpb=cb001c0d283dd884efe06770d033a50fb1bc6c7d;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/ihex.c b/bfd/ihex.c index 68671cc623..ca36043fe2 100644 --- a/bfd/ihex.c +++ b/bfd/ihex.c @@ -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;