Separate out data window
[binutils-gdb.git] / bfd / elfcode.h
index a0487b0843cdbdbe640de536e6caefc7a2e5cbae..9a73c3b71f52daa83b17350489c9275aca2bc3d2 100644 (file)
@@ -749,12 +749,9 @@ elf_object_p (bfd *abfd)
                  != 0))
            abfd->flags &= ~D_PAGED;
        }
-    }
 
-  /* A further sanity check.  */
-  if (i_ehdrp->e_shnum != 0)
-    {
-      if (i_ehdrp->e_shstrndx >= elf_numsections (abfd))
+      if (i_ehdrp->e_shstrndx >= elf_numsections (abfd)
+         || i_shdrp[i_ehdrp->e_shstrndx].sh_type != SHT_STRTAB)
        {
          /* PR 2257:
             We used to just goto got_wrong_format_error here