From 27a64ef36a09a489c0e70e8c6bc1a2783ea1d714 Mon Sep 17 00:00:00 2001 From: Aaron Merey Date: Tue, 23 Jul 2024 15:26:26 -0400 Subject: [PATCH] strip.c: Apply --permissive when writing the debug file The --permissive command line option is applied when writing the binary being stripped but is not applied when writing its separate debug file. Change this so that --permissive applies to writing the debug file as well. Signed-off-by: Aaron Merey --- src/strip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/strip.c b/src/strip.c index 6436443dc..403e0f6fb 100644 --- a/src/strip.c +++ b/src/strip.c @@ -2464,6 +2464,8 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, if (debug_fname != NULL && removing_sections) { /* Finally write the file. */ + if (permissive) + elf_flagelf (debugelf, ELF_C_SET, ELF_F_PERMISSIVE); if (unlikely (elf_update (debugelf, ELF_C_WRITE) == -1)) { error (0, 0, _("while writing '%s': %s"), -- 2.47.2