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