[PATCH] D98795: [lld-macho][NFC] Minor refactor of Writer::run()

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 14:45:55 PDT 2021


int3 accepted this revision.
int3 added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lld/MachO/Writer.cpp:834-835
+void Writer::finalizeAddressses() {
+  // dyld requires __LINKEDIT segment to always exist (even if empty).
+  linkEditSegment = getOrCreateOutputSegment(segment_names::linkEdit);
+
----------------
move this back to where it originally was (at the start of `Writer::run()`) so the "No more sections nor segments may be created after these methods run" comment holds true?


================
Comment at: lld/MachO/Writer.cpp:858-859
 
-  // Sort and assign sections to their respective segments. No more sections nor
-  // segments may be created after these methods run.
   createOutputSections();
----------------
gkm wrote:
> int3 wrote:
> > This comment seems worth keeping
> OK for now ... until BRET (branch-range-extension thunks) creates more sections after this point during address assignment. ;)
hmm... "No more segments or sections (aside from branch range extension thunks) may be created after this point"?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98795



More information about the llvm-commits mailing list