From 838c7cc03e4193df6d3089655d5a2ddd3efabd0b Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 3 Jun 2025 14:06:36 +0200 Subject: 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 --- src/unstrip.c | 1 + 1 file changed, 1 insertion(+) 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); -- cgit v1.2.3