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 <m...@klomp.org> --- src/unstrip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/unstrip.c b/src/unstrip.c index 81c5496f43a0..6c2a98ef96f2 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); -- 2.49.0