Skip to content

Commit

Permalink
macho: align __stub_helper preamble to 4bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Jan 23, 2024
1 parent c0b3552 commit f39557e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MachO/synthetic.zig
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub const StubsSection = struct {
pub const StubsHelperSection = struct {
pub inline fn preambleSize(cpu_arch: std.Target.Cpu.Arch) usize {
return switch (cpu_arch) {
.x86_64 => 15,
.x86_64 => 16,
.aarch64 => 6 * @sizeOf(u32),
else => 0,
};
Expand Down Expand Up @@ -288,6 +288,7 @@ pub const StubsHelperSection = struct {
try writer.writeInt(i32, @intCast(dyld_private_addr - sect.addr - 3 - 4), .little);
try writer.writeAll(&.{ 0x41, 0x53, 0xff, 0x25 });
try writer.writeInt(i32, @intCast(dyld_stub_binder_addr - sect.addr - 11 - 4), .little);
try writer.writeByte(0x90);
},
.aarch64 => {
{
Expand Down

0 comments on commit f39557e

Please sign in to comment.