Index: ELF/SyntheticSections.cpp =================================================================== --- ELF/SyntheticSections.cpp +++ ELF/SyntheticSections.cpp @@ -2414,8 +2414,7 @@ template static std::vector -readPubNamesAndTypes(DWARFContext &Dwarf, uint32_t Idx) { - auto &Obj = static_cast &>(Dwarf.getDWARFObj()); +readPubNamesAndTypes(LLDDwarfObj &Obj, uint32_t Idx) { const DWARFSection &PubNames = Obj.getGnuPubNamesSection(); const DWARFSection &PubTypes = Obj.getGnuPubTypesSection(); @@ -2514,12 +2513,13 @@ parallelForEachN(0, Sections.size(), [&](size_t I) { ObjFile *File = Sections[I]->getFile(); - DWARFContext Dwarf(make_unique>(File)); + auto Obj = make_unique>(File); + NameTypes[I] = readPubNamesAndTypes(*Obj, I); + DWARFContext Dwarf(std::move(Obj)); Chunks[I].Sec = Sections[I]; Chunks[I].CompilationUnits = readCuList(Dwarf); Chunks[I].AddressAreas = readAddressAreas(Dwarf, Sections[I]); - NameTypes[I] = readPubNamesAndTypes(Dwarf, I); }); auto *Ret = make();