summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2016-09-09 14:35:36 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2016-09-09 14:35:36 +0000
commitcd574a5e462ae438b9ab2c24244b7e8d5e6a9337 (patch)
tree68a59ff9a6831147ecee6227ffd04ef29c6db8f5 /lld/ELF/ScriptParser.cpp
parente3c7f54e9309d33c92d5f8f9e7a7224658518d51 (diff)
downloadbcm5719-llvm-cd574a5e462ae438b9ab2c24244b7e8d5e6a9337.tar.gz
bcm5719-llvm-cd574a5e462ae438b9ab2c24244b7e8d5e6a9337.zip
Recommit [ELF] - Versionscript: do not treat non-wildcarded names as wildcards.
Fixed code that was not checked before on windows for me, because of testcases that are disabled on that platform atm. 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: 281049
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index 19e20b653bc..97d68d92318 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;
}
OpenPOWER on IntegriCloud