aboutsummaryrefslogtreecommitdiffstats
path: root/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-14 15:39:25 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-14 15:39:25 +0000
commit1eafc0458f4bb4547fe78c62b78312ad4f719c38 (patch)
treedb247ebc1d3d05750e31ef4b162cf9ab4af9ddef /ELF/LinkerScript.cpp
parentb047fead11133644be3dbae34b85be39ce2819e9 (diff)
downloadsrc-1eafc0458f4bb4547fe78c62b78312ad4f719c38.tar.gz
src-1eafc0458f4bb4547fe78c62b78312ad4f719c38.zip
Vendor import of lld release_40 branch r292009:vendor/lld/lld-release_40-r292009
Notes
Notes: svn path=/vendor/lld/dist/; revision=312181 svn path=/vendor/lld/lld-release_40-r292009/; revision=312182; tag=vendor/lld/lld-release_40-r292009
Diffstat (limited to 'ELF/LinkerScript.cpp')
-rw-r--r--ELF/LinkerScript.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/ELF/LinkerScript.cpp b/ELF/LinkerScript.cpp
index 59ef36c87de5..887ca12537ad 100644
--- a/ELF/LinkerScript.cpp
+++ b/ELF/LinkerScript.cpp
@@ -1014,6 +1014,7 @@ private:
void readAnonymousDeclaration();
void readVersionDeclaration(StringRef VerStr);
std::vector<SymbolVersion> readSymbols();
+ void readLocals();
ScriptConfiguration &Opt = *ScriptConfig;
bool IsUnderSysroot;
@@ -1861,17 +1862,22 @@ void ScriptParser::readAnonymousDeclaration() {
if (consume("global:") || peek() != "local:")
Config->VersionScriptGlobals = readSymbols();
- // Next, read local symbols.
- if (consume("local:")) {
- if (consume("*")) {
+ readLocals();
+ expect("}");
+ expect(";");
+}
+
+void ScriptParser::readLocals() {
+ if (!consume("local:"))
+ return;
+ std::vector<SymbolVersion> Locals = readSymbols();
+ for (SymbolVersion V : Locals) {
+ if (V.Name == "*") {
Config->DefaultSymbolVersion = VER_NDX_LOCAL;
- expect(";");
- } else {
- setError("local symbol list for anonymous version is not supported");
+ continue;
}
+ Config->VersionScriptLocals.push_back(V);
}
- expect("}");
- expect(";");
}
// Reads a list of symbols, e.g. "VerStr { global: foo; bar; local: *; };".
@@ -1885,16 +1891,7 @@ void ScriptParser::readVersionDeclaration(StringRef VerStr) {
if (consume("global:") || peek() != "local:")
Config->VersionDefinitions.back().Globals = readSymbols();
- // Read local symbols.
- if (consume("local:")) {
- if (consume("*")) {
- Config->DefaultSymbolVersion = VER_NDX_LOCAL;
- expect(";");
- } else {
- for (SymbolVersion V : readSymbols())
- Config->VersionScriptLocals.push_back(V);
- }
- }
+ readLocals();
expect("}");
// Each version may have a parent version. For example, "Ver2"