[PATCH] D15868: Sort MachO sections in -r mode

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 4 14:26:29 PST 2016


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

Assuming those comments are just clarifying existing requirements, this looks good to me. Thanks!


================
Comment at: lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp:409
@@ -408,9 +408,3 @@
 void Util::organizeSections() {
-  if (_ctx.outputMachOType() == llvm::MachO::MH_OBJECT) {
-    // Leave sections ordered as normalized file specified.
-    uint32_t sectionIndex = 1;
-    for (SectionInfo *si : _sectionInfos) {
-      si->finalSectionIndex = sectionIndex++;
-    }
-  } else {
-    switch (_ctx.outputMachOType()) {
+  // NOTE!: Keep this in sync with assignAddressesToSections.
+  switch (_ctx.outputMachOType()) {
----------------
Is this a new requirement with this patch, or are you just documenting an existing requirement?

================
Comment at: lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp:482
@@ -489,2 +481,3 @@
 void Util::assignAddressesToSections(const NormalizedFile &file) {
+  // NOTE!: Keep this in sync with organizeSections.
   size_t hlcSize = headerAndLoadCommandsSize(file);
----------------
And here?


http://reviews.llvm.org/D15868





More information about the llvm-commits mailing list