[ELF] - Fix for: PR29093 - version script does not support [chars] wildcards

GNU ld supports [chars] wildcards in version scripts, to match a single instance of any of the chars.
Here is an extern example from libstdc++'s version script in FreeBSD:

extern "C++"
{
...

std::locale::_[T-Za-z]*;                                                                                                       
std::[A-Zm]*;                                                            
std::n[^u]*;                                                             
std::nu[^m]*;                                                            
std::num[^e]*;
...

}

Patch adds support for scripts above. This is PR29093.

Differential revision: https://reviews.llvm.org/D23803

llvm-svn: 280799
This commit is contained in:
George Rimar
2016-09-07 10:19:44 +00:00
parent 1ed49fd384
commit 51da9c7178
3 changed files with 115 additions and 6 deletions

View File

@@ -76,7 +76,7 @@ std::vector<StringRef> ScriptParserBase::tokenize(StringRef S) {
// so that you can write "file-name.cpp" as one bare token, for example.
size_t Pos = S.find_first_not_of(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
"0123456789_.$/\\~=+[]*?-:!<>");
"0123456789_.$/\\~=+[]*?-:!<>^");
// A character that cannot start a word (which is usually a
// punctuation) forms a single character token.