Revert r314616: Run writeTo() concurrently.

This reverts commit r314616 because nested parallel-for loops can hang.
Our ThreadPoolExecutor is not necessarily able to handle nested calls.

llvm-svn: 315098
This commit is contained in:
Rui Ueyama 2017-10-06 20:12:43 +00:00
parent 469350810a
commit 8ad23dcd8b
1 changed files with 2 additions and 4 deletions

View File

@ -1911,16 +1911,14 @@ template <class ELFT> void Writer<ELFT>::writeSections() {
// In -r or -emit-relocs mode, write the relocation sections first as in
// ELf_Rel targets we might find out that we need to modify the relocated
// section while doing it.
parallelForEach(OutputSections, [&](OutputSection *Sec) {
for (OutputSection *Sec : OutputSections)
if (Sec->Type == SHT_REL || Sec->Type == SHT_RELA)
Sec->writeTo<ELFT>(Buf + Sec->Offset);
});
parallelForEach(OutputSections, [&](OutputSection *Sec) {
for (OutputSection *Sec : OutputSections)
if (Sec != Out::Opd && Sec != EhFrameHdr && Sec->Type != SHT_REL &&
Sec->Type != SHT_RELA)
Sec->writeTo<ELFT>(Buf + Sec->Offset);
});
// The .eh_frame_hdr depends on .eh_frame section contents, therefore
// it should be written after .eh_frame is written.