[ELF] Lookup INPUT argument in the current directory
If an argument of the INPUT directive is a regular path, linker should
lookup it in the current folder first.
The fix does not contain any test cases because I think it is not a good
idea to pollute a current folder (which in general might be arbitrary)
by test files.
Differential Revision: http://reviews.llvm.org/D15027
llvm-svn: 254178
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 5e56b50..883b623 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -179,6 +179,8 @@
Driver->addFile(Saver.save(Config->Sysroot + "/" + S.substr(1)));
} else if (S.startswith("-l")) {
Driver->addFile(searchLibrary(S.substr(2)));
+ } else if (sys::fs::exists(S)) {
+ Driver->addFile(S);
} else {
std::string Path = findFromSearchPaths(S);
if (Path.empty())