Revert "Revert r311468: If --dynamic-list is given, only those symbols are preemptible"

If --dynamic-list is given, only those symbols are preemptible.

This allows combining --dynamic-list and version scripts too. The
version script controls which symbols are visible, and --dynamic-list
controls which of those are preemptible.

This fixes pr34053.

llvm-svn: 312757
This commit is contained in:
Rafael Espindola
2017-09-07 23:19:09 +00:00
parent ec2b3fce1b
commit b7d0be5896
6 changed files with 105 additions and 4 deletions

View File

@@ -180,9 +180,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() {