[PATCH] D77893: [lld] Merge Mach-O input sections

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 17:18:11 PDT 2020


smeenai added inline comments.


================
Comment at: lld/MachO/MergedOutputSection.cpp:39
+    isecAddr += i->getSize();
+    fileSize += i->getFileSize();
+  }
----------------
@int3 is changing this to take the section's alignment into account in D79050, so this should follow suit.


================
Comment at: lld/MachO/MergedOutputSection.cpp:47
+    isec->writeTo(buf);
+    buf += isec->getFileSize();
+  }
----------------
Same here.


================
Comment at: lld/MachO/Writer.cpp:346
+    addr += section->getSize();
+    fileOff += section->getFileSize();
   }
----------------
Would it make sense to have each `OutputSection` store its `fileOff` (in addition to or instead of the `OutputSegment` holding it), so that we don't need to recompute it in the writeSections loop below?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77893





More information about the llvm-commits mailing list