| ... | ... | @@ -50,7 +50,7 @@ pub fn getTargetAtomIndex(self: Relocation, macho_file: *MachO) ?Atom.Index { |
| 50 | 50 | return macho_file.getAtomIndexForSymbol(self.target); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | | pub fn resolve(self: Relocation, macho_file: *MachO, atom_index: Atom.Index, code: []u8) !void { |
| 53 | pub fn resolve(self: Relocation, macho_file: *MachO, atom_index: Atom.Index, code: []u8) void { |
| 54 | 54 | const arch = macho_file.base.options.target.cpu.arch; |
| 55 | 55 | const atom = macho_file.getAtom(atom_index); |
| 56 | 56 | const source_sym = atom.getSymbol(macho_file); |
| ... | ... | @@ -68,18 +68,13 @@ pub fn resolve(self: Relocation, macho_file: *MachO, atom_index: Atom.Index, cod |
| 68 | 68 | }); |
| 69 | 69 | |
| 70 | 70 | switch (arch) { |
| 71 | | .aarch64 => return self.resolveAarch64(source_addr, target_addr, code), |
| 72 | | .x86_64 => return self.resolveX8664(source_addr, target_addr, code), |
| 71 | .aarch64 => self.resolveAarch64(source_addr, target_addr, code), |
| 72 | .x86_64 => self.resolveX8664(source_addr, target_addr, code), |
| 73 | 73 | else => unreachable, |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | | fn resolveAarch64( |
| 78 | | self: Relocation, |
| 79 | | source_addr: u64, |
| 80 | | target_addr: i64, |
| 81 | | code: []u8, |
| 82 | | ) !void { |
| 77 | fn resolveAarch64(self: Relocation, source_addr: u64, target_addr: i64, code: []u8) void { |
| 83 | 78 | const rel_type = @intToEnum(macho.reloc_type_arm64, self.type); |
| 84 | 79 | if (rel_type == .ARM64_RELOC_UNSIGNED) { |
| 85 | 80 | return switch (self.length) { |
| ... | ... | @@ -212,12 +207,7 @@ fn resolveAarch64( |
| 212 | 207 | } |
| 213 | 208 | } |
| 214 | 209 | |
| 215 | | fn resolveX8664( |
| 216 | | self: Relocation, |
| 217 | | source_addr: u64, |
| 218 | | target_addr: i64, |
| 219 | | code: []u8, |
| 220 | | ) !void { |
| 210 | fn resolveX8664(self: Relocation, source_addr: u64, target_addr: i64, code: []u8) void { |
| 221 | 211 | const rel_type = @intToEnum(macho.reloc_type_x86_64, self.type); |
| 222 | 212 | switch (rel_type) { |
| 223 | 213 | .X86_64_RELOC_BRANCH, |