[ELF] - Fix incorrect logic in VersionScriptParser::parseVersion()
Previously the next sample script would generate 2 entries in
Config->SymbolVersions with the same version name.
VERSION {
global: c;
};
That happened because parseVersionSymbols() was called twice.
At first for "global:" and since there is no local tag, it was called again.
Patch fixes the issue, testcase was updated to demonstrate.
Differential revision: http://reviews.llvm.org/D21640
llvm-svn: 273663
diff --git a/lld/ELF/SymbolListFile.cpp b/lld/ELF/SymbolListFile.cpp
index 4855f57..fccfd28 100644
--- a/lld/ELF/SymbolListFile.cpp
+++ b/lld/ELF/SymbolListFile.cpp
@@ -90,7 +90,7 @@
}
if (peek() == "local:")
parseLocal();
- else
+ else if (peek() != "}")
parseVersionSymbols(Version);
expect("}");