| ... | ... | @@ -393,11 +393,15 @@ pub fn parseRelocs(self: *Atom, relocs: []macho.relocation_info, context: RelocC |
| 393 | 393 | try addGotEntry(target, context); |
| 394 | 394 | }, |
| 395 | 395 | .ARM64_RELOC_UNSIGNED => { |
| 396 | | assert(rel.r_extern == 1); |
| 397 | 396 | addend = if (rel.r_length == 3) |
| 398 | 397 | mem.readIntLittle(i64, self.code.items[offset..][0..8]) |
| 399 | 398 | else |
| 400 | 399 | mem.readIntLittle(i32, self.code.items[offset..][0..4]); |
| 400 | if (rel.r_extern == 0) { |
| 401 | const seg = context.object.load_commands.items[context.object.segment_cmd_index.?].Segment; |
| 402 | const target_sect_base_addr = seg.sections.items[rel.r_symbolnum - 1].addr; |
| 403 | addend -= @intCast(i64, target_sect_base_addr); |
| 404 | } |
| 401 | 405 | try self.addPtrBindingOrRebase(rel, target, context); |
| 402 | 406 | }, |
| 403 | 407 | else => {}, |