summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Merey <[email protected]>2024-07-23 15:26:26 -0400
committerAaron Merey <[email protected]>2024-07-23 15:36:03 -0400
commit27a64ef36a09a489c0e70e8c6bc1a2783ea1d714 (patch)
treeec6de5b5ffb2b2b57df1212ffca3bbbeb236de71 /src
parent7508696d107ca01b65ce8273c881462a8658f90f (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/strip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/strip.c b/src/strip.c
index 6436443d..403e0f6f 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"),