Implement Mach-O TLS access for x64 newBE

This commit is contained in:
bjorn3
2021-01-21 18:05:37 +01:00
parent 207f60a18e
commit 81d248c057
4 changed files with 43 additions and 2 deletions

View File

@@ -3016,6 +3016,19 @@ pub(crate) fn emit(
);
sink.put4(0); // offset
}
Inst::MachOTlsGetAddr { ref symbol } => {
// movq gv@tlv(%rip), %rdi
sink.put1(0x48); // REX.w
sink.put1(0x8b); // MOV
sink.put1(0x3d); // ModRM byte
emit_reloc(sink, state, Reloc::MachOX86_64Tlv, symbol, -4);
sink.put4(0); // offset
// callq *(%rdi)
sink.put1(0xff);
sink.put1(0x17);
}
}
state.clear_post_insn();