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

Peter Collingbourne peter at pcc.me.uk
Fri Jun 19 14:15:31 PDT 2015


On Sun, May 31, 2015 at 08:20:38PM -0000, Rui Ueyama wrote:
> 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());

I think this will add search paths in reverse order.

Thanks,
-- 
Peter



More information about the llvm-commits mailing list