From: Mark Wielaard Date: Tue, 3 Jun 2025 12:06:36 +0000 (+0200) Subject: unstrip: update unstripped_shnum when adding a new section X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=838c7cc03e4193df6d3089655d5a2ddd3efabd0b;p=thirdparty%2Felfutils.git unstrip: update unstripped_shnum when adding a new section If some section doesn't match between the stripped and unstripped file we invent a new one. Make sure to also update the shnum value. * src/unstrip.c (copy_elided_sections): Update unstripped_shnum. Signed-off-by: Mark Wielaard --- diff --git a/src/unstrip.c b/src/unstrip.c index 81c5496f..6c2a98ef 100644 --- a/src/unstrip.c +++ b/src/unstrip.c @@ -1666,6 +1666,7 @@ more sections in stripped file than debug file -- arguments reversed?")); ELF_CHECK (newdata != NULL && gelf_update_shdr (sec->outscn, &sec->shdr), _("cannot add new section: %s")); + unstripped_shnum++; if (strtab == NULL) strtab = dwelf_strtab_init (true);