+2019-04-28 Mark Wielaard <mark@klomp.org>
+
+ * size.c (show_sysv): Call INTERNAL_ERROR if gelf_getshdr
+ returns NULL.
+ (show_sysv_one_line): Call error with EXIT_FAILURE if
+ gelf_getshdr returns NULL.
+
2019-04-28 Mark Wielaard <mark@klomp.org>
* nm.c (show_symbols_sysv): Check gelf_getshdr doesn't return
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (shdr == NULL)
+ INTERNAL_ERROR (fullname);
+
/* Ignore all sections which are not used at runtime. */
if ((shdr->sh_flags & SHF_ALLOC) != 0)
{
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ if (unlikely (shdr == NULL))
+ error (EXIT_FAILURE, 0, gettext ("cannot get section header"));
+
/* Ignore all sections which are not used at runtime. */
if ((shdr->sh_flags & SHF_ALLOC) == 0)
continue;