Index: lld/ELF/ScriptLexer.h =================================================================== --- lld/ELF/ScriptLexer.h +++ lld/ELF/ScriptLexer.h @@ -24,7 +24,7 @@ void setError(const Twine &msg); void tokenize(MemoryBufferRef mb); - static StringRef skipSpace(StringRef s); + StringRef skipSpace(StringRef s); bool atEOF(); StringRef next(); StringRef peek(); Index: lld/ELF/ScriptLexer.cpp =================================================================== --- lld/ELF/ScriptLexer.cpp +++ lld/ELF/ScriptLexer.cpp @@ -146,7 +146,7 @@ if (s.startswith("/*")) { size_t e = s.find("*/", 2); if (e == StringRef::npos) { - error("unclosed comment in a linker script"); + setError("unclosed comment in a linker script"); return ""; } s = s.substr(e + 2); Index: lld/test/ELF/linkerscript/diag6.test =================================================================== --- lld/test/ELF/linkerscript/diag6.test +++ lld/test/ELF/linkerscript/diag6.test @@ -4,4 +4,4 @@ SECTIONS /* -CHECK: error: unclosed comment in a linker script +CHECK: error: {{.*}}diag6.test:1: unclosed comment in a linker script