mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 05:32:25 +00:00
MultiJITTest.cpp: Tweak getPointerToNamedFunction() to be aware of also Windows x64.
In import thunk, jmp is: - On x86, 0xFF 0x25 [disp32]. - On x64, 0xFF 0x25 [pcrel32]. See also my r144178. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203523 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fc77954998
commit
2ab1641041
@ -174,6 +174,14 @@ TEST(MultiJitTest, JitPool) {
|
||||
EXPECT_TRUE(fa != 0);
|
||||
fa = *(intptr_t *)fa; // Bound value of IAT
|
||||
}
|
||||
#elif defined(__x86_64__)
|
||||
// getPointerToNamedFunction might be indirect jump
|
||||
// on Win32 x64 --enable-shared.
|
||||
// FF 25 <pcrel32>: jmp *(RIP + pointer to IAT)
|
||||
if (sa != fa && memcmp((char *)fa, "\xFF\x25", 2) == 0) {
|
||||
fa += *(int32_t *)(fa + 2) + 6; // Address to IAT(RIP)
|
||||
fa = *(intptr_t *)fa; // Bound value of IAT
|
||||
}
|
||||
#endif
|
||||
EXPECT_TRUE(sa == fa);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user