Skip to content

Commit

Permalink
macho: match __stubs and __stub_helpers alignment with ld64
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Jan 23, 2024
1 parent 68b56dc commit 5ab7f4b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/MachO.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@ fn calcSectionSizes(self: *MachO) !void {
const header = &self.sections.items(.header)[idx];
header.size = self.stubs.size(self);
header.@"align" = switch (cpu_arch) {
.x86_64 => 0,
.x86_64 => 1,
.aarch64 => 2,
else => 0,
};
Expand All @@ -1771,11 +1771,7 @@ fn calcSectionSizes(self: *MachO) !void {
if (self.stubs_helper_sect_index) |idx| {
const header = &self.sections.items(.header)[idx];
header.size = self.stubs_helper.size(self);
header.@"align" = switch (cpu_arch) {
.x86_64 => 0,
.aarch64 => 2,
else => 0,
};
header.@"align" = 2;
}

if (self.la_symbol_ptr_sect_index) |idx| {
Expand Down

0 comments on commit 5ab7f4b

Please sign in to comment.