Nicholas Chapman
2009-Jan-13 00:06 UTC
[LLVMdev] Crash when using InstallLazyFunctionCreator and JIT on Linux x64.
Hi everyone, I'm running into a problem using JIT compilation on Linux x86-64. LLVM revision is 62079. I've installed a lazy function creator using InstallLazyFunctionCreator(). I return the value 0x5ce64e from my lazyFunctionCreator function. However, the disassembled JIT'd function looks like this: 0x00007f45ef2b6018: sub $0x8,%rsp 0x00007f45ef2b601c: mov $0x7f45ef2b6010,%rax 0x00007f45ef2b6026: movss (%rax,%riz,1),%xmm0 0x00007f45ef2b602b: movss %xmm0,0x4(%rsp) 0x00007f45ef2b6031: callq 0x7f46005ce64e 0x00007f45ef2b6036: ucomiss 0x4(%rsp),%xmm0 0x00007f45ef2b603b: setnp %cl 0x00007f45ef2b603e: sete %al 0x00007f45ef2b6041: and %cl,%al 0x00007f45ef2b6043: add $0x8,%rsp 0x00007f45ef2b6047: retq As you can see, the upper 32 bits of the function address that the function is making a call to are incorrect. Consequently, the program makes an invalid memory access when jumping to 0x7f46005ce64e. Is this a known bug, or am I doing something wrong? Any help would be greatly appreciated. Thanks, Nicholas Chapman