Blob Blame History Raw
diff -rupN --no-dereference binutils-2.32/libiberty/simple-object-elf.c binutils-2.32-new/libiberty/simple-object-elf.c
--- binutils-2.32/libiberty/simple-object-elf.c	2019-01-19 17:01:34.000000000 +0100
+++ binutils-2.32-new/libiberty/simple-object-elf.c	2019-11-19 20:47:15.208667119 +0100
@@ -549,6 +549,14 @@ simple_object_elf_match (unsigned char h
       return NULL;
     }
 
+  if (eor->shstrndx == 0)
+    {
+      *errmsg = "invalid ELF shstrndx == 0";
+      *err = 0;
+      XDELETE (eor);
+      return NULL;
+    }
+
   return (void *) eor;
 }