[dsymutil] Only look for ThinLTO suffixes if we failed to find symbol.

Only look for symbols with the ThinLTO suffix if we fail to find the
symbol.
This commit is contained in:
Jonas Devlieghere 2021-03-23 10:52:01 -07:00
parent c181724a9b
commit 1c9b83edaf
1 changed files with 9 additions and 7 deletions

View File

@ -463,13 +463,15 @@ void MachODebugMapParser::handleStabSymbolTableEntry(uint32_t StringIndex,
}
// ThinLTO adds a unique suffix to exported private symbols.
for (auto Iter = CurrentObjectAddresses.begin();
Iter != CurrentObjectAddresses.end(); ++Iter) {
llvm::StringRef SymbolName = Iter->getKey();
auto Pos = SymbolName.rfind(".llvm.");
if (Pos != llvm::StringRef::npos && SymbolName.substr(0, Pos) == Name) {
ObjectSymIt = Iter;
break;
if (ObjectSymIt == CurrentObjectAddresses.end()) {
for (auto Iter = CurrentObjectAddresses.begin();
Iter != CurrentObjectAddresses.end(); ++Iter) {
llvm::StringRef SymbolName = Iter->getKey();
auto Pos = SymbolName.rfind(".llvm.");
if (Pos != llvm::StringRef::npos && SymbolName.substr(0, Pos) == Name) {
ObjectSymIt = Iter;
break;
}
}
}