PR24689 again, string table corruption

Message ID 20190623134249.GG3662@bubble.grove.modra.org
State New
Headers show
Series
  • PR24689 again, string table corruption
Related show

Commit Message

Alan Modra June 23, 2019, 1:42 p.m.
Depending on optimisation level and gcc version, git commit 890f750a3b
introduces a false positive warning that i_shdrp may be used
uninitialized.

	PR 24689
	* elfcode.h (elf_object_p): Warning fix.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 5180f79a74..9a73c3b71f 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -749,11 +749,7 @@  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)
 	  || i_shdrp[i_ehdrp->e_shstrndx].sh_type != SHT_STRTAB)
 	{