From 05763f43b3d8318c95891650c11ab243ce9a1fd5 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Tue, 14 Sep 2021 10:28:58 +0200 Subject: [PATCH] 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. --- src/link/MachO/Object.zig | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/link/MachO/Object.zig b/src/link/MachO/Object.zig index a7e312e6c7..27da019be8 100644 --- a/src/link/MachO/Object.zig +++ b/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| {