Commit 05763f43b3

Jakub Konka <kubkon@jakubkonka.com>
2021-09-14 10:28:58
macho: disable splitting sections into atoms in release
since we don't actually benefit from it just yet, and getting it right for release and dead code stripping will require some more thought put into it.
1 parent a38b636
Changed files (1)
src
link
src/link/MachO/Object.zig
@@ -540,12 +540,15 @@ pub fn parseIntoAtoms(
         // Symbols within this section only.
         const filtered_nlists = NlistWithIndex.filterInSection(sorted_nlists, sect);
 
+        // TODO rewrite and re-enable dead-code stripping optimisation. I think it might make sense
+        // to do this in a standalone pass after we parse the sections as atoms.
         // In release mode, if the object file was generated with dead code stripping optimisations,
         // note it now and parse sections as atoms.
-        const is_splittable = blk: {
-            if (macho_file.base.options.optimize_mode == .Debug) break :blk false;
-            break :blk self.header.?.flags & macho.MH_SUBSECTIONS_VIA_SYMBOLS != 0;
-        };
+        // const is_splittable = blk: {
+        //     if (macho_file.base.options.optimize_mode == .Debug) break :blk false;
+        //     break :blk self.header.?.flags & macho.MH_SUBSECTIONS_VIA_SYMBOLS != 0;
+        // };
+        const is_splittable = false;
 
         macho_file.has_dices = macho_file.has_dices or blk: {
             if (self.text_section_index) |index| {