summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/strip.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/strip.c b/src/strip.c
index 15a43ff7..aad1035b 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -2448,6 +2448,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
/* Create the real output file. First rename, then change the
mode. */
close (debug_fd);
+ unlink (debug_fname);
int rename_result = rename (tmp_debug_fname, debug_fname);
debug_fd = open (debug_fname, O_RDONLY | O_BINARY);
if (rename_result != 0 || debug_fd == -1