authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-09-14 10:28:58+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-09-14 10:28:58+02:00
log05763f43b3d8318c95891650c11ab243ce9a1fd5
tree1696d4aeafafd97ba54b8cca584381f144ab4102
parenta38b636045c0384faad1565d47dfbf774821021e

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 files changed, 7 insertions(+), 4 deletions(-)

src/link/MachO/Object.zig+7-4
...@@ -540,12 +540,15 @@ pub fn parseIntoAtoms(...@@ -540,12 +540,15 @@ pub fn parseIntoAtoms(
540 // Symbols within this section only.540 // Symbols within this section only.
541 const filtered_nlists = NlistWithIndex.filterInSection(sorted_nlists, sect);541 const filtered_nlists = NlistWithIndex.filterInSection(sorted_nlists, sect);
542542
543 // TODO rewrite and re-enable dead-code stripping optimisation. I think it might make sense
544 // to do this in a standalone pass after we parse the sections as atoms.
543 // In release mode, if the object file was generated with dead code stripping optimisations,545 // In release mode, if the object file was generated with dead code stripping optimisations,
544 // note it now and parse sections as atoms.546 // note it now and parse sections as atoms.
545 const is_splittable = blk: {547 // const is_splittable = blk: {
546 if (macho_file.base.options.optimize_mode == .Debug) break :blk false;548 // if (macho_file.base.options.optimize_mode == .Debug) break :blk false;
547 break :blk self.header.?.flags & macho.MH_SUBSECTIONS_VIA_SYMBOLS != 0;549 // break :blk self.header.?.flags & macho.MH_SUBSECTIONS_VIA_SYMBOLS != 0;
548 };550 // };
551 const is_splittable = false;
549552
550 macho_file.has_dices = macho_file.has_dices or blk: {553 macho_file.has_dices = macho_file.has_dices or blk: {
551 if (self.text_section_index) |index| {554 if (self.text_section_index) |index| {