Index: bolt/lib/Rewrite/RewriteInstance.cpp =================================================================== --- bolt/lib/Rewrite/RewriteInstance.cpp +++ bolt/lib/Rewrite/RewriteInstance.cpp @@ -901,6 +901,23 @@ if (LastAddr == Address) // don't repeat markers continue; + // Following IHI0056B: + // > Each interval starts at the address defined by the mapping + // > symbol, and continues up to, but not including, the address + // > defined by the next (in address order) mapping symbol or the end + // > of the section or segment. + // + // If the current symbol is a ST_Function, reset the marker symbol + // type to executable CODE. + if (!BC->isMarker(*Sym)) { + auto SymType = cantFail(Sym->getType()); + if (SymType == SymbolRef::ST_Function) { + SortedMarkerSymbols.push_back( + MarkerSym{Address, MarkerSymType::CODE}); + LastAddr = Address; + IsData = false; + } + } MarkerSymType MarkerType = BC->getMarkerType(*Sym); if (MarkerType != MarkerSymType::NONE) { SortedMarkerSymbols.push_back(MarkerSym{Address, MarkerType});