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
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);
}