summaryrefslogtreecommitdiffstats
path: root/src/unstrip.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2020-06-09 18:21:36 +0200
committerMark Wielaard <[email protected]>2020-06-09 18:21:36 +0200
commitc0d643e7d91fc002c9fecd83277c62a0e56ef76f (patch)
tree89b5cf6673baa2cb206fdf245f4e30fe884945ad /src/unstrip.c
parent14030673602a4f331f348decd51e5f0160719f0e (diff)
parent5643e037cb7a38ed5d52f50421be706ea8014e3d (diff)
Merge tag 'elfutils-0.177' into mjw/RH-DTSdts-0.177
elfutils 0.177 release Conflicts: libebl/eblopenbackend.c Removed try_dlopen and csky. tests/run-strip-reloc.sh Removed csky tests.
Diffstat (limited to 'src/unstrip.c')
-rw-r--r--src/unstrip.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/unstrip.c b/src/unstrip.c
index 3495b1d9..fc878325 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -644,6 +644,7 @@ add_new_section_symbols (Elf_Scn *old_symscn, size_t old_shnum,
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"));
@@ -677,6 +678,7 @@ add_new_section_symbols (Elf_Scn *old_symscn, size_t old_shnum,
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"));
@@ -1326,6 +1328,7 @@ new_shstrtab (Elf *unstripped, size_t unstripped_shnum,
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,
@@ -1349,6 +1352,7 @@ new_shstrtab (Elf *unstripped, size_t unstripped_shnum,
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;