| ... | ... | @@ -387,7 +387,7 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void { |
| 387 | 387 | const symtab = &self.load_commands.items[self.symtab_cmd_index.?].Symtab; |
| 388 | 388 | const file_size = symtab.stroff + symtab.strsize - linkedit.fileoff; |
| 389 | 389 | linkedit.filesize = file_size; |
| 390 | | linkedit.vmsize = mem.alignForwardGeneric(u64, file_size, 0x1000); |
| 390 | linkedit.vmsize = mem.alignForwardGeneric(u64, file_size, 0x4000); |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | if (self.cmd_table_dirty) { |
| ... | ... | @@ -1163,8 +1163,8 @@ pub fn populateMissingMetadata(self: *MachO) !void { |
| 1163 | 1163 | |
| 1164 | 1164 | // const program_code_size_hint = self.base.options.program_code_size_hint; |
| 1165 | 1165 | const program_code_size_hint = 128; |
| 1166 | | const file_size = mem.alignForwardGeneric(u64, program_code_size_hint, 0x1000); |
| 1167 | | const off = @intCast(u32, self.findFreeSpace(file_size, 0x1000)); // TODO maybe findFreeSpace should return u32 directly? |
| 1166 | const file_size = mem.alignForwardGeneric(u64, program_code_size_hint, 0x4000); |
| 1167 | const off = @intCast(u32, self.findFreeSpace(file_size, 0x4000)); // TODO maybe findFreeSpace should return u32 directly? |
| 1168 | 1168 | const flags = macho.S_REGULAR | macho.S_ATTR_PURE_INSTRUCTIONS | macho.S_ATTR_SOME_INSTRUCTIONS; |
| 1169 | 1169 | |
| 1170 | 1170 | log.debug("found __text section free space 0x{x} to 0x{x}\n", .{ off, off + file_size }); |
| ... | ... | @@ -1237,7 +1237,7 @@ pub fn populateMissingMetadata(self: *MachO) !void { |
| 1237 | 1237 | .reserved3 = 0, |
| 1238 | 1238 | }); |
| 1239 | 1239 | |
| 1240 | | const segment_size = mem.alignForwardGeneric(u64, file_size, 0x1000); |
| 1240 | const segment_size = mem.alignForwardGeneric(u64, file_size, 0x4000); |
| 1241 | 1241 | data_segment.vmsize = segment_size; |
| 1242 | 1242 | data_segment.filesize = segment_size; |
| 1243 | 1243 | data_segment.fileoff = off; |