Index: lld/trunk/ELF/SyntheticSections.cpp =================================================================== --- lld/trunk/ELF/SyntheticSections.cpp +++ lld/trunk/ELF/SyntheticSections.cpp @@ -1813,12 +1813,13 @@ } template GdbIndexSection *elf::createGdbIndex() { - std::vector Chunks; - for (InputSection *Sec : getDebugInfoSections()) { - ObjFile *F = Sec->getFile(); + std::vector Sections = getDebugInfoSections(); + std::vector Chunks(Sections.size()); + parallelForEachN(0, Chunks.size(), [&](size_t I) { + ObjFile *F = Sections[I]->getFile(); DWARFContext Dwarf(make_unique>(F)); - Chunks.push_back(readDwarf(Dwarf, Sec)); - } + Chunks[I] = readDwarf(Dwarf, Sections[I]); + }); return make(std::move(Chunks)); }