diff --git a/src/MachO.zig b/src/MachO.zig index ee02216b..da0938f3 100644 --- a/src/MachO.zig +++ b/src/MachO.zig @@ -1248,6 +1248,12 @@ fn calcSectionSizes(self: *MachO) !void { else => 0, }; } + + if (self.la_symbol_ptr_sect_index) |idx| { + const header = &self.sections.items(.header)[idx]; + header.size = self.la_symbol_ptr.size(self); + header.@"align" = 3; + } } fn initSegments(self: *MachO) !void { diff --git a/src/MachO/synthetic.zig b/src/MachO/synthetic.zig index 982d891f..3f4bb923 100644 --- a/src/MachO/synthetic.zig +++ b/src/MachO/synthetic.zig @@ -146,7 +146,12 @@ pub const StubsHelperSection = struct { } }; -pub const LaSymbolPtrSection = struct {}; +pub const LaSymbolPtrSection = struct { + pub fn size(laptr: LaSymbolPtrSection, macho_file: *MachO) usize { + _ = laptr; + return macho_file.stubs.symbols.items.len * @sizeOf(u64); + } +}; pub const TlvSection = struct { symbols: std.ArrayListUnmanaged(Symbol.Index) = .{},