[PATCH] D45349: COFF: Create output sections early. NFCI.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 5 20:14:26 PDT 2018


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM

Nice!



================
Comment at: lld/COFF/Writer.cpp:336-397
     fatal("image size (" + Twine(FileSize) + ") " +
         "exceeds maximum allowable size (" + Twine(UINT32_MAX) + ")");
 
   // We must do this before opening the output file, as it depends on being able
   // to read the contents of the existing output file.
   PreviousBuildId = loadExistingBuildId(Config->OutputFile);
   openFile(Config->OutputFile);
----------------
auto -> uint32_t?


================
Comment at: lld/COFF/Writer.cpp:406
+  SmallDenseMap<StringRef, OutputSection *> Sections;
+  auto createSection = [&](StringRef Name, uint32_t Perms) {
+    auto Sec = make<OutputSection>(Name);
----------------
createSection -> CreateSection


================
Comment at: lld/COFF/Writer.cpp:462
+  // Finally, move some output sections to the end.
+  auto sectionOrder = [&](OutputSection *S) {
+    // .reloc should come last of all since it refers to RVAs of data in the
----------------
sectionOrder -> SectionOrder


https://reviews.llvm.org/D45349





More information about the llvm-commits mailing list