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

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 09:13:28 PDT 2016


emaste added inline comments.

================
Comment at: ELF/SymbolTable.cpp:580
@@ -579,3 +579,3 @@
 static bool hasWildcard(StringRef S) {
-  return S.find_first_of("?*") != StringRef::npos;
+  return S.find_first_of("?*[]-^") != StringRef::npos;
 }
----------------
grimar wrote:
> emaste wrote:
> > grimar wrote:
> > > Though after revisiting, since '-' and '^' can not be used without '[' or ']' we can remove it from here to reduce checks I think.
> > Yeah, that's my point. If `foo-bar` is not valid it'll just be handled as it is today (without the wildcard change).
> I wonder if we need to check ']' then :) It makes no sence without '[',
> so we probably can check only for '['..
Good point, I agree. A version script entry must have one of `?*[` to be a wildcard.

Note that `\` is also supported to escape a character, so e.g. `foo\*bar` is not a wildcard.  But this is a complexity we can revisit later.


https://reviews.llvm.org/D23803





More information about the llvm-commits mailing list