Remove ppc860, ppc750cl, ppc7450 insns from common ppc.
[binutils-gdb.git] / bfd / tekhex.c
index 94b47739f561675db231cb934f4b08e6c9ba9dcd..ccc68f92d397306fe0a38f827af77d4f33a6b0fc 100644 (file)
@@ -397,7 +397,7 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
            return FALSE;
        }
       alt_section = NULL;
-      while (*src)
+      while (src < src_end && *src)
        {
          switch (*src)
            {
@@ -407,7 +407,13 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
                return FALSE;
              if (!getvalue (&src, &val, src_end))
                return FALSE;
+             if (val < section->vma)
+               val = section->vma;
              section->size = val - section->vma;
+             /* PR 17512: file: objdump-s-endless-loop.tekhex.
+                Check for overlarge section sizes.  */
+             if (section->size & 0x80000000)
+               return FALSE;
              section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
              break;
            case '0':