authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-11-16 16:22:20+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-11-26 11:50:09+01:00
log4a3d757f3e57d115ef2f6889f52a06e013bcfc06
tree8a4d312c4cdc55ee1b6431ce74ddb7f90a474935
parent7a407246ed503d93218bb0292150ffbf12dfb735

stage2 MachO: reduce size of __TEXT segment


1 files changed, 3 insertions(+), 1 deletions(-)

src/link/MachO.zig+3-1
...@@ -1161,7 +1161,9 @@ pub fn populateMissingMetadata(self: *MachO) !void {...@@ -1161,7 +1161,9 @@ pub fn populateMissingMetadata(self: *MachO) !void {
1161 text_segment.cmdsize += @sizeOf(macho.section_64);1161 text_segment.cmdsize += @sizeOf(macho.section_64);
1162 text_segment.nsects += 1;1162 text_segment.nsects += 1;
11631163
1164 const file_size = mem.alignForwardGeneric(u64, self.base.options.program_code_size_hint, 0x1000);1164 // const program_code_size_hint = self.base.options.program_code_size_hint;
1165 const program_code_size_hint = 128;
1166 const file_size = mem.alignForwardGeneric(u64, program_code_size_hint, 0x1000);
1165 const off = @intCast(u32, self.findFreeSpace(file_size, 0x1000)); // TODO maybe findFreeSpace should return u32 directly?1167 const off = @intCast(u32, self.findFreeSpace(file_size, 0x1000)); // TODO maybe findFreeSpace should return u32 directly?
1166 const flags = macho.S_REGULAR | macho.S_ATTR_PURE_INSTRUCTIONS | macho.S_ATTR_SOME_INSTRUCTIONS;1168 const flags = macho.S_REGULAR | macho.S_ATTR_PURE_INSTRUCTIONS | macho.S_ATTR_SOME_INSTRUCTIONS;
11671169