diff options
author | Rui Ueyama <ruiu@google.com> | 2015-10-12 23:49:04 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-10-12 23:49:04 +0000 |
commit | 63d8880b38e720bcc6c03f64dcea522e93627ec3 (patch) | |
tree | 32d91313f1459ad82b0914d633bc9df9570b7c4b /lld/ELF/LinkerScript.cpp | |
parent | 18255a333e4a6822f772fb00eb23d5afad53f746 (diff) | |
download | bcm5719-llvm-63d8880b38e720bcc6c03f64dcea522e93627ec3.tar.gz bcm5719-llvm-63d8880b38e720bcc6c03f64dcea522e93627ec3.zip |
Fix test breakage on Windows.
llvm-svn: 250127
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index ddd82663eee..1939424eb8b 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -19,6 +19,7 @@ #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/StringSaver.h" +#include <cctype> using namespace llvm; using namespace lld; @@ -138,8 +139,12 @@ void LinkerScript::expect(StringRef Expect) { error(Expect + " expected, but got " + Tok); } +static bool isDOSAbsolutePath(StringRef S) { + return isalpha(S[0]) && S.substr(1).startswith(":\\"); +} + void LinkerScript::addFile(StringRef S) { - if (S.startswith("/")) { + if (S.startswith("/") || isDOSAbsolutePath(S)) { Driver->addFile(S); } else if (S.startswith("=")) { if (Config->Sysroot.empty()) |