forked from OSchip/llvm-project
				
			Run writeTo() concurrently.
I don't know why we didn't use parallelForEach to call writeTo, but there should be no reason to not do that, as most writeTo functions are safe to run concurrently. llvm-svn: 314616
This commit is contained in:
		
							parent
							
								
									bffac0eb81
								
							
						
					
					
						commit
						cb222035c2
					
				| 
						 | 
					@ -1910,14 +1910,16 @@ template <class ELFT> void Writer<ELFT>::writeSections() {
 | 
				
			||||||
  // In -r or -emit-relocs mode, write the relocation sections first as in
 | 
					  // 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
 | 
					  // ELf_Rel targets we might find out that we need to modify the relocated
 | 
				
			||||||
  // section while doing it.
 | 
					  // section while doing it.
 | 
				
			||||||
  for (OutputSection *Sec : OutputSections)
 | 
					  parallelForEach(OutputSections, [&](OutputSection *Sec) {
 | 
				
			||||||
    if (Sec->Type == SHT_REL || Sec->Type == SHT_RELA)
 | 
					    if (Sec->Type == SHT_REL || Sec->Type == SHT_RELA)
 | 
				
			||||||
      Sec->writeTo<ELFT>(Buf + Sec->Offset);
 | 
					      Sec->writeTo<ELFT>(Buf + Sec->Offset);
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  for (OutputSection *Sec : OutputSections)
 | 
					  parallelForEach(OutputSections, [&](OutputSection *Sec) {
 | 
				
			||||||
    if (Sec != Out::Opd && Sec != EhFrameHdr && Sec->Type != SHT_REL &&
 | 
					    if (Sec != Out::Opd && Sec != EhFrameHdr && Sec->Type != SHT_REL &&
 | 
				
			||||||
        Sec->Type != SHT_RELA)
 | 
					        Sec->Type != SHT_RELA)
 | 
				
			||||||
      Sec->writeTo<ELFT>(Buf + Sec->Offset);
 | 
					      Sec->writeTo<ELFT>(Buf + Sec->Offset);
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // The .eh_frame_hdr depends on .eh_frame section contents, therefore
 | 
					  // The .eh_frame_hdr depends on .eh_frame section contents, therefore
 | 
				
			||||||
  // it should be written after .eh_frame is written.
 | 
					  // it should be written after .eh_frame is written.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue