| ... | ... | @@ -27,6 +27,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { |
| 27 | 27 | macho_step.dependOn(testMhExecuteHeader(b, .{ .target = default_target })); |
| 28 | 28 | macho_step.dependOn(testNoDeadStrip(b, .{ .target = default_target })); |
| 29 | 29 | macho_step.dependOn(testNoExportsDylib(b, .{ .target = default_target })); |
| 30 | macho_step.dependOn(testPagezeroSize(b, .{ .target = default_target })); |
| 30 | 31 | macho_step.dependOn(testRelocatable(b, .{ .target = default_target })); |
| 31 | 32 | macho_step.dependOn(testRelocatableZig(b, .{ .target = default_target })); |
| 32 | 33 | macho_step.dependOn(testSectionBoundarySymbols(b, .{ .target = default_target })); |
| ... | ... | @@ -862,6 +863,40 @@ fn testObjc(b: *Build, opts: Options) *Step { |
| 862 | 863 | return test_step; |
| 863 | 864 | } |
| 864 | 865 | |
| 866 | fn testPagezeroSize(b: *Build, opts: Options) *Step { |
| 867 | const test_step = addTestStep(b, "macho-pagezero-size", opts); |
| 868 | |
| 869 | { |
| 870 | const exe = addExecutable(b, opts, .{ .name = "main", .c_source_bytes = "int main () { return 0; }" }); |
| 871 | exe.pagezero_size = 0x4000; |
| 872 | |
| 873 | const check = exe.checkObject(); |
| 874 | check.checkInHeaders(); |
| 875 | check.checkExact("LC 0"); |
| 876 | check.checkExact("segname __PAGEZERO"); |
| 877 | check.checkExact("vmaddr 0"); |
| 878 | check.checkExact("vmsize 4000"); |
| 879 | check.checkInHeaders(); |
| 880 | check.checkExact("segname __TEXT"); |
| 881 | check.checkExact("vmaddr 4000"); |
| 882 | test_step.dependOn(&check.step); |
| 883 | } |
| 884 | |
| 885 | { |
| 886 | const exe = addExecutable(b, opts, .{ .name = "main", .c_source_bytes = "int main () { return 0; }" }); |
| 887 | exe.pagezero_size = 0; |
| 888 | |
| 889 | const check = exe.checkObject(); |
| 890 | check.checkInHeaders(); |
| 891 | check.checkExact("LC 0"); |
| 892 | check.checkExact("segname __TEXT"); |
| 893 | check.checkExact("vmaddr 0"); |
| 894 | test_step.dependOn(&check.step); |
| 895 | } |
| 896 | |
| 897 | return test_step; |
| 898 | } |
| 899 | |
| 865 | 900 | fn testRelocatable(b: *Build, opts: Options) *Step { |
| 866 | 901 | const test_step = addTestStep(b, "macho-relocatable", opts); |
| 867 | 902 | |