aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-11-16 16:22:20 +0100
committerJakub Konka <kubkon@jakubkonka.com>2020-11-26 11:50:09 +0100
commit4a3d757f3e57d115ef2f6889f52a06e013bcfc06 (patch)
tree8a4d312c4cdc55ee1b6431ce74ddb7f90a474935
parent7a407246ed503d93218bb0292150ffbf12dfb735 (diff)
downloadzig-4a3d757f3e57d115ef2f6889f52a06e013bcfc06.tar.gz
zig-4a3d757f3e57d115ef2f6889f52a06e013bcfc06.zip
stage2 MachO: reduce size of __TEXT segment
-rw-r--r--src/link/MachO.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index 4492054b57..ffa409fbe1 100644
--- a/src/link/MachO.zig
+++ b/src/link/MachO.zig
@@ -1161,7 +1161,9 @@ pub fn populateMissingMetadata(self: *MachO) !void {
text_segment.cmdsize += @sizeOf(macho.section_64);
text_segment.nsects += 1;
- const file_size = mem.alignForwardGeneric(u64, self.base.options.program_code_size_hint, 0x1000);
+ // const program_code_size_hint = self.base.options.program_code_size_hint;
+ const program_code_size_hint = 128;
+ const file_size = mem.alignForwardGeneric(u64, program_code_size_hint, 0x1000);
const off = @intCast(u32, self.findFreeSpace(file_size, 0x1000)); // TODO maybe findFreeSpace should return u32 directly?
const flags = macho.S_REGULAR | macho.S_ATTR_PURE_INSTRUCTIONS | macho.S_ATTR_SOME_INSTRUCTIONS;