[PATCH] D126800: Write output sections in parallel

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 12:30:51 PDT 2022


oontvoo added inline comments.


================
Comment at: lld/MachO/Writer.cpp:1083-1092
 void Writer::writeSections() {
   uint8_t *buf = buffer->getBufferStart();
+  std::vector<const OutputSection *> osecs;
   for (const OutputSegment *seg : outputSegments)
     for (const OutputSection *osec : seg->getSections())
-      osec->writeTo(buf + osec->fileOff);
+      osecs.emplace_back(osec);
+
----------------
int3 wrote:
> oontvoo wrote:
> > Does this not introduce indeterminism in the final binaries, and hence mess up caching?
> > (specifically the ordering of the output sections may change even if the input does not..)
> there's no sorting going on here though
NVM - resolved  :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126800/new/

https://reviews.llvm.org/D126800



More information about the llvm-commits mailing list