diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 92e6c9ba1f57..86c45bf63cb1 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -1027,14 +1027,13 @@ void EHOutputSection::addSectionAux( if (Config->EhFrameHdr) C.FdeEncoding = getFdeEncoding(D); - StringRef Personality; + SymbolBody *Personality = nullptr; if (HasReloc) { uint32_t SymIndex = RelI->getSymbol(Config->Mips64EL); - SymbolBody &Body = *S->getFile()->getSymbolBody(SymIndex)->repl(); - Personality = Body.getName(); + Personality = S->getFile()->getSymbolBody(SymIndex)->repl(); } - std::pair CieInfo(Entry, Personality); + std::pair CieInfo(Entry, Personality); auto P = CieMap.insert(std::make_pair(CieInfo, Cies.size())); if (P.second) { Cies.push_back(C); diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index a7b67484c940..3d3984f08479 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -342,7 +342,7 @@ private: std::vector> Cies; // Maps CIE content + personality to a index in Cies. - llvm::DenseMap, unsigned> CieMap; + llvm::DenseMap, unsigned> CieMap; }; template