mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
macho: rewrite movq to leaq when TLV is not external pointer
This commit is contained in:
parent
5823f19c5e
commit
93cc5496e1
@ -843,8 +843,10 @@ fn resolveRelocsX86(
|
||||
log.debug(" | target_addr = 0x{x}", .{adjusted_target_addr});
|
||||
const disp = try calcPcRelativeDisplacementX86(source_addr, adjusted_target_addr, 0);
|
||||
|
||||
// We need to rewrite the opcode from movq to leaq.
|
||||
atom_code[rel_offset - 2] = 0x8d;
|
||||
if (zld.tlv_ptr_table.get(target) == null) {
|
||||
// We need to rewrite the opcode from movq to leaq.
|
||||
atom_code[rel_offset - 2] = 0x8d;
|
||||
}
|
||||
|
||||
mem.writeIntLittle(i32, atom_code[rel_offset..][0..4], disp);
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user