diff options
author | George Rimar <grimar@accesssoftek.com> | 2016-09-09 13:58:07 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2016-09-09 13:58:07 +0000 |
commit | b5e77c47fb8c047959e97e841f2d3210da005ce0 (patch) | |
tree | dc47fd34deb11505a5f3e22ea14429c73c79d48d /lld/ELF/ScriptParser.cpp | |
parent | 57d9dfa9ac7618aea8de6d1d1d940db6c7474737 (diff) | |
download | llvm-b5e77c47fb8c047959e97e841f2d3210da005ce0.zip llvm-b5e77c47fb8c047959e97e841f2d3210da005ce0.tar.gz llvm-b5e77c47fb8c047959e97e841f2d3210da005ce0.tar.bz2 |
Recommit [ELF] - Versionscript: do not treat non-wildcarded names as wildcards.
Fixed code that was not checked by testcases that are disabled on windows.
Inital commit message:
"[ELF] - Versionscript: do not treat non-wildcarded names as wildcards."
Previously we incorrectly handled cases when symbol name in extern c++ tag
was enclosed in quotes. Next case was treated as wildcard:
GLIBCXX_3.4 {
extern "C++" {
"aaa*"
}
But it should have not. Quotes around aaa here means that we should have do exact
name matching.
That is PR30268 which has name with pointer is interpreted as wildcard by lld:
extern "C++" {
"operator delete[](void*)";
Patch fixes the issue.
Differential revision: https://reviews.llvm.org/D24229
llvm-svn: 281045
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r-- | lld/ELF/ScriptParser.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp index 19e20b6..97d68d92 100644 --- a/lld/ELF/ScriptParser.cpp +++ b/lld/ELF/ScriptParser.cpp @@ -60,14 +60,17 @@ std::vector<StringRef> ScriptParserBase::tokenize(StringRef S) { if (S.empty()) return Ret; - // Quoted token. + // Quoted token. Note that double-quote characters are parts of a token + // because, in a glob match context, only unquoted tokens are interpreted + // as glob patterns. Double-quoted tokens are literal patterns in that + // context. if (S.startswith("\"")) { size_t E = S.find("\"", 1); if (E == StringRef::npos) { error("unclosed quote"); return {}; } - Ret.push_back(S.substr(1, E - 1)); + Ret.push_back(S.take_front(E + 1)); S = S.substr(E + 1); continue; } |