+2019-04-28 Mark Wielaard <mark@klomp.org>
+
+ * unstrip.c (add_new_section_symbols): Call ELF_CHECK after
+ gelf_getsymshndx.
+ (new_shstrtab): Call ELF_CHECK after gelf_getshdr.
+
2019-04-28 Mark Wielaard <mark@klomp.org>
* size.c (show_sysv): Call INTERNAL_ERROR if gelf_getshdr
GElf_Word shndx = SHN_UNDEF;
GElf_Sym *sym = gelf_getsymshndx (old_symdata, shndxdata,
i, &sym_mem, &shndx);
+ ELF_CHECK (sym != NULL, _("cannot get symbol table entry: %s"));
ELF_CHECK (gelf_update_symshndx (symdata, shndxdata, i,
sym, shndx),
_("cannot update symbol table: %s"));
GElf_Word shndx = SHN_UNDEF;
GElf_Sym *sym = gelf_getsymshndx (old_symdata, shndxdata,
i, &sym_mem, &shndx);
+ ELF_CHECK (sym != NULL, _("cannot get symbol table entry: %s"));
ELF_CHECK (gelf_update_symshndx (symdata, shndxdata,
i + added, sym, shndx),
_("cannot update symbol table: %s"));
Elf_Scn *scn = elf_getscn (unstripped, i + 1);
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
const char *name = get_section_name (i + 1, shdr, shstrtab);
unstripped_strent[i] = dwelf_strtab_add (strtab, name);
ELF_CHECK (unstripped_strent[i] != NULL,
Elf_Scn *scn = elf_getscn (unstripped, i + 1);
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ ELF_CHECK (shdr != NULL, _("cannot get section header: %s"));
shdr->sh_name = dwelf_strent_off (unstripped_strent[i]);
if (i + 1 == unstripped_shstrndx)
shdr->sh_size = strtab_data->d_size;