diff options
author | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2015-02-12 18:21:50 +0000 |
---|---|---|
committer | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2015-02-12 18:21:50 +0000 |
commit | a07d9b9a4b9a51262cb413b2e726f5bfcdc5e8e6 (patch) | |
tree | a440d1d3c857d1d1529cc9bb4c897f07ce39ac8e /llvm/tools/gold/gold-plugin.cpp | |
parent | 032951990475de8b19110be4950dc08addb13bec (diff) | |
download | bcm5719-llvm-a07d9b9a4b9a51262cb413b2e726f5bfcdc5e8e6.tar.gz bcm5719-llvm-a07d9b9a4b9a51262cb413b2e726f5bfcdc5e8e6.zip |
gold-plugin: delete the output file for OT_DISABLE
bfd creates the output file early, so calling exit(0) is not enough, the file needs to be explicitly deleted.
Patch by: H.J. Lu <hjl.tools@gmail.com>
llvm-svn: 228946
Diffstat (limited to 'llvm/tools/gold/gold-plugin.cpp')
-rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 7 |
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; } |