diff options
author | Rui Ueyama <ruiu@google.com> | 2017-08-22 16:31:47 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2017-08-22 16:31:47 +0000 |
commit | 9cbbacb910312f86fef2d17e4d79bfd93a42a51b (patch) | |
tree | ac505fc2b4d1ed65455d04075321350632453fa1 /lld/ELF/ScriptParser.cpp | |
parent | 2724d453256140b3ca71f4d4cd64845cb0d16e28 (diff) | |
download | bcm5719-llvm-9cbbacb910312f86fef2d17e4d79bfd93a42a51b.tar.gz bcm5719-llvm-9cbbacb910312f86fef2d17e4d79bfd93a42a51b.zip |
If --dynamic-list is given, only those symbols are preemptible
Patch by Rafael EspĂndola.
This is PR34053.
The implementation is a bit of a hack, given the precise location where
IsPreemtible is set, it cannot be used from
SymbolTable::handleAnonymousVersion.
I could add another method to SymbolTable if you think that would be
better.
Differential Revision: https://reviews.llvm.org/D36499
llvm-svn: 311468
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r-- | lld/ELF/ScriptParser.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp index fdeeafd39fc..6f0dd879a2d 100644 --- a/lld/ELF/ScriptParser.cpp +++ b/lld/ELF/ScriptParser.cpp @@ -175,9 +175,22 @@ static ExprValue bitOr(ExprValue A, ExprValue B) { void ScriptParser::readDynamicList() { expect("{"); - readAnonymousDeclaration(); - if (!atEOF()) + std::vector<SymbolVersion> Locals; + std::vector<SymbolVersion> Globals; + std::tie(Locals, Globals) = readSymbols(); + expect(";"); + + if (!atEOF()) { setError("EOF expected, but got " + next()); + return; + } + if (!Locals.empty()) { + setError("\"local:\" scope not supported in --dynamic-list"); + return; + } + + for (SymbolVersion V : Globals) + Config->DynamicList.push_back(V); } void ScriptParser::readVersionScript() { |