[lld] r273426 - [ELF] - Show explicit error if extern keyword is used in version script.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 22 08:02:57 PDT 2016
Author: grimar
Date: Wed Jun 22 10:02:57 2016
New Revision: 273426
URL: http://llvm.org/viewvc/llvm-project?rev=273426&view=rev
Log:
[ELF] - Show explicit error if extern keyword is used in version script.
Since we do not have plans to support it in closest future,
it is better than common script parsing error.
Modified:
lld/trunk/ELF/SymbolListFile.cpp
lld/trunk/test/ELF/version-script-err.s
Modified: lld/trunk/ELF/SymbolListFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolListFile.cpp?rev=273426&r1=273425&r2=273426&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolListFile.cpp (original)
+++ lld/trunk/ELF/SymbolListFile.cpp Wed Jun 22 10:02:57 2016
@@ -116,6 +116,8 @@ void VersionScriptParser::parseVersionSy
}
for (;;) {
+ if (peek() == "extern")
+ setError("extern keyword is not supported");
StringRef Cur = peek();
if (Cur == "}" || Cur == "local:" || Error)
return;
Modified: lld/trunk/test/ELF/version-script-err.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/version-script-err.s?rev=273426&r1=273425&r2=273426&view=diff
==============================================================================
--- lld/trunk/test/ELF/version-script-err.s (original)
+++ lld/trunk/test/ELF/version-script-err.s Wed Jun 22 10:02:57 2016
@@ -8,3 +8,8 @@
// RUN: not ld.lld --version-script %terr1.script -shared %t.o -o %t.so 2>&1 | \
// RUN: FileCheck -check-prefix=ERR1 %s
// ERR1: unclosed quote
+
+// RUN: echo "VERSION { extern "C++" {}; }; " > %terr2.script
+// RUN: not ld.lld --version-script %terr2.script -shared %t.o -o %t.so 2>&1 | \
+// RUN: FileCheck -check-prefix=ERR2 %s
+// ERR2: extern keyword is not supported
More information about the llvm-commits
mailing list