From ffc7e32760dc94963e889e19c3bba4e269492738 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Mon, 18 Dec 2023 16:45:09 +0100 Subject: [PATCH] macho: fix __objc_stubs alignment --- src/MachO.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/MachO.zig b/src/MachO.zig index f60e89b2..40fedae7 100644 --- a/src/MachO.zig +++ b/src/MachO.zig @@ -1692,7 +1692,11 @@ fn calcSectionSizes(self: *MachO) !void { if (self.objc_stubs_sect_index) |idx| { const header = &self.sections.items(.header)[idx]; header.size = self.objc_stubs.size(self); - header.@"align" = 1; + header.@"align" = switch (cpu_arch) { + .x86_64 => 0, + .aarch64 => 2, + else => 0, + }; } }