diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -950,7 +950,8 @@ } // Ignore input hot markers - if (SymName == "__hot_start" || SymName == "__hot_end") + if (SymName == "__hot_start" || SymName == "__hot_end" || + SymName.startswith("__typeid_")) continue; FileSymRefs[Address] = Symbol; @@ -2622,6 +2623,8 @@ assert((IsAArch64 || IsSectionRelocation || BD->nameStartsWith(SymbolName) || BD->nameStartsWith("PG" + SymbolName) || + StringRef(SymbolName).startswith("__typeid_") || + BD->nameStartsWith("__typeid_") || (BD->nameStartsWith("ANONYMOUS") && (BD->getSectionName().startswith(".plt") || BD->getSectionName().endswith(".plt")))) && @@ -2640,7 +2643,8 @@ // in relocation sections can get through here too, from .plt. assert( (IsAArch64 || IsSectionRelocation || - BC->getSectionNameForAddress(SymbolAddress)->startswith(".plt")) && + BC->getSectionNameForAddress(SymbolAddress)->startswith(".plt") || + StringRef(SymbolName).startswith("__typeid_")) && "known symbols should not resolve to anonymous locals"); if (IsSectionRelocation) {