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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228946
91177308-0d34-0410-b5e6-
96231b3b80d8
llvm_shutdown();
if (options::TheOutputType == options::OT_BC_ONLY ||
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);