[lld] r238683 - COFF: /libpath should not take precedence over the current directory.

Rui Ueyama ruiu at google.com
Sun May 31 13:20:38 PDT 2015


Author: ruiu
Date: Sun May 31 15:20:37 2015
New Revision: 238683

URL: http://llvm.org/viewvc/llvm-project?rev=238683&view=rev
Log:
COFF: /libpath should not take precedence over the current directory.

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=238683&r1=238682&r2=238683&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Sun May 31 15:20:37 2015
@@ -209,9 +209,11 @@ bool LinkerDriver::link(int Argc, const
   Config->MachineType = MTOrErr.get();
 
   // Handle /libpath
-  // (Inserting at front of a vector is okay because it's short.)
-  for (auto *Arg : Args->filtered(OPT_libpath))
-    SearchPaths.insert(SearchPaths.begin(), Arg->getValue());
+  for (auto *Arg : Args->filtered(OPT_libpath)) {
+    // Inserting at front of a vector is okay because it's short.
+    // +1 because the first entry is always "." (current directory).
+    SearchPaths.insert(SearchPaths.begin() + 1, Arg->getValue());
+  }
 
   // Handle /nodefaultlib:<filename>
   for (auto *Arg : Args->filtered(OPT_nodefaultlib))





More information about the llvm-commits mailing list