diff --git a/elf/passes.cc b/elf/passes.cc index 4f8710534e..714abbdc2f 100644 --- a/elf/passes.cc +++ b/elf/passes.cc @@ -609,9 +609,8 @@ void apply_version_script(Context &ctx) { for (VersionPattern &elem : ctx.arg.version_patterns) { std::vector vec; - std::regex re_glob("[*?]", std::regex_constants::optimize | std::regex_constants::nosubs); for (std::string_view pat : elem.patterns) { - if (!std::regex_search(pat.begin(), pat.end(), re_glob)) { + if (pat.find_first_of("*?") == pat.npos) { Symbol *sym = intern(ctx, pat); if (sym->file && !sym->file->is_dso) sym->ver_idx = elem.ver_idx;