diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2024-07-10 16:36:32 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2024-07-18 09:13:08 +0200 |
| commit | 174de37cefde3b22b02fee5982e7bacead4d200f (patch) | |
| tree | de8e99729e11de1b9116ebd3da5077ad722d9993 /src/link/MachO/thunks.zig | |
| parent | 5b4c0cc1f9c4cb047064cffb70bc649b83681814 (diff) | |
| download | zig-174de37cefde3b22b02fee5982e7bacead4d200f.tar.gz zig-174de37cefde3b22b02fee5982e7bacead4d200f.zip | |
macho: fix compile errors
Diffstat (limited to 'src/link/MachO/thunks.zig')
| -rw-r--r-- | src/link/MachO/thunks.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/link/MachO/thunks.zig b/src/link/MachO/thunks.zig index d832e6fcf6..2f2bd177e4 100644 --- a/src/link/MachO/thunks.zig +++ b/src/link/MachO/thunks.zig @@ -37,7 +37,7 @@ pub fn createThunks(sect_id: u8, macho_file: *MachO) !void { // Scan relocs in the group and create trampolines for any unreachable callsite try scanRelocs(thunk_index, gpa, atoms[start..i], macho_file); - thunk.value = try advance(header, thunk.size(), .@"4"); + thunk.value = advance(header, thunk.size(), .@"4"); log.debug("thunk({d}) : {}", .{ thunk_index, thunk.fmt(macho_file) }); } @@ -99,8 +99,8 @@ pub const Thunk = struct { return header.addr + thunk.value; } - pub fn getTargetAddress(thunk: Thunk, sym_index: Symbol.Index, macho_file: *MachO) u64 { - return thunk.getAddress(macho_file) + thunk.symbols.getIndex(sym_index).? * trampoline_size; + pub fn getTargetAddress(thunk: Thunk, ref: MachO.Ref, macho_file: *MachO) u64 { + return thunk.getAddress(macho_file) + thunk.symbols.getIndex(ref).? * trampoline_size; } pub fn write(thunk: Thunk, macho_file: *MachO, writer: anytype) !void { |
