summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/tools/gold/gold-plugin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index dd6d47f5d70..b1a28c52290 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -869,8 +869,13 @@ static ld_plugin_status all_symbols_read_hook(void) {
llvm_shutdown();
if (options::TheOutputType == options::OT_BC_ONLY ||
- options::TheOutputType == options::OT_DISABLE)
+ options::TheOutputType == options::OT_DISABLE) {
+ if (options::TheOutputType == options::OT_DISABLE)
+ // Remove the output file here since ld.bfd creates the output file
+ // early.
+ sys::fs::remove(output_name);
exit(0);
+ }
return Ret;
}
OpenPOWER on IntegriCloud