Fix bug in -nostdlib.

We still have to skip a token inside SEARCH_DIR() when -nostdlib is
specified. Previuosly, we didn't skip it, so it caused a parse error.

llvm-svn: 281001
This commit is contained in:
Rui Ueyama
2016-09-08 23:26:54 +00:00
parent ec6a774ed2
commit 86c5fb8296
2 changed files with 5 additions and 2 deletions

View File

@@ -886,8 +886,9 @@ void ScriptParser::readPhdrs() {
void ScriptParser::readSearchDir() {
expect("(");
StringRef Tok = next();
if (!Config->Nostdlib)
Config->SearchPaths.push_back(next());
Config->SearchPaths.push_back(Tok);
expect(")");
}

View File

@@ -88,7 +88,9 @@
// -nostdlib
// RUN: echo 'SEARCH_DIR(' %t.dir ')' > %t.script
// RUN: ld.lld -o %t3 %t.o -script %t.script -lls
// RUN: not ld.lld -o %t3 %t.o -script %t.script -lls -nostdlib
// RUN: not ld.lld -o %t3 %t.o -script %t.script -lls -nostdlib \
// RUN: 2>&1 | FileCheck --check-prefix=NOSTDLIB %s
// NOSTDLIB: unable to find library -lls
.globl _start,_bar
_start: