[lld] r244424 - COFF: Do not fall through if /lib is processed.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 9 13:45:17 PDT 2015
Author: ruiu
Date: Sun Aug 9 15:45:17 2015
New Revision: 244424
URL: http://llvm.org/viewvc/llvm-project?rev=244424&view=rev
Log:
COFF: Do not fall through if /lib is processed.
Modified:
lld/trunk/COFF/Driver.cpp
Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=244424&r1=244423&r2=244424&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Sun Aug 9 15:45:17 2015
@@ -240,6 +240,14 @@ static uint64_t getDefaultImageBase() {
}
void LinkerDriver::link(llvm::ArrayRef<const char *> ArgsArr) {
+ // If the first command line argument is "/lib", link.exe acts like lib.exe.
+ // We call our own implementation of lib.exe that understands bitcode files.
+ if (ArgsArr.size() > 1 && StringRef(ArgsArr[1]).equals_lower("/lib")) {
+ if (llvm::libDriverMain(ArgsArr.slice(1)) != 0)
+ error("lib failed");
+ return;
+ }
+
// Needed for LTO.
llvm::InitializeAllTargetInfos();
llvm::InitializeAllTargets();
@@ -248,12 +256,6 @@ void LinkerDriver::link(llvm::ArrayRef<c
llvm::InitializeAllAsmPrinters();
llvm::InitializeAllDisassemblers();
- // If the first command line argument is "/lib", link.exe acts like lib.exe.
- // We call our own implementation of lib.exe that understands bitcode files.
- if (ArgsArr.size() > 1 && StringRef(ArgsArr[1]).equals_lower("/lib"))
- if (llvm::libDriverMain(ArgsArr.slice(1)) != 0)
- error("lib failed");
-
// Parse command line options.
llvm::opt::InputArgList Args = Parser.parseLINK(ArgsArr.slice(1));
More information about the llvm-commits
mailing list