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
This commit is contained in:
Rui Ueyama
2017-08-22 16:31:47 +00:00
parent 2724d45325
commit 9cbbacb910
6 changed files with 105 additions and 4 deletions

View File

@@ -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() {