[PATCH] D21732: [ELF] Initial support for wildcard in symbol versions

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 26 02:22:25 PDT 2016


ruiu added a comment.

So a natural question to ask is how slow it is if you have symbol patterns that contain "*"? I'd appreciate if you run a benchmark.

Also, how slow is it if you use matchStr function defined in LinkerScript.cpp?


================
Comment at: ELF/SymbolTable.cpp:435
@@ -434,1 +434,3 @@
 template <class ELFT>
+std::vector<SymbolBody *> SymbolTable<ELFT>::findAll(StringRef Prefix) {
+  std::vector<SymbolBody *> Result;
----------------
This parameter is not actually a prefix but a pattern that could end with "*". So I'd name this Pattern.

================
Comment at: ELF/SymbolTable.cpp:438-440
@@ +437,5 @@
+  if (!Prefix.endswith("*")) {
+    SymbolBody *B = find(Prefix);
+    if (B != nullptr)
+      Result.push_back(B);
+    return Result;
----------------
  if (SymbolBody *B = find(Prefix))
    Result.push_back(B);


http://reviews.llvm.org/D21732





More information about the llvm-commits mailing list