diff options
Diffstat (limited to 'lld/ELF/Driver.cpp')
-rw-r--r-- | lld/ELF/Driver.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index a2e4559bab3..e8d3639483b 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -862,8 +862,12 @@ void LinkerDriver::createFiles(opt::InputArgList &Args) { addFile(Arg->getValue(), /*WithLOption=*/false); break; case OPT_script: - if (Optional<MemoryBufferRef> MB = readFile(Arg->getValue())) - readLinkerScript(*MB); + if (Optional<std::string> Path = searchLinkerScript(Arg->getValue())) { + if (Optional<MemoryBufferRef> MB = readFile(*Path)) + readLinkerScript(*MB); + break; + } + error(Twine("cannot find linker script ") + Arg->getValue()); break; case OPT_as_needed: Config->AsNeeded = true; |