[LLVMdev] Migration from JIT to MCJIT

Jiong Wang jiwang at tilera.com
Tue Apr 9 06:42:03 PDT 2013


? 2013/4/9 21:08, Weiss, Eran ??:
> Hi,
>
> I'm migrating my code (running on mac) from using JIT to MCJIT. My 
> code generates in memory, mostly using the llvm-c api, and then runs 
> the generated code.
> When I try to use MCJIT I encounter a problem with relocations of 
> external symbols -- functions compiled statically beforehand with gcc.
>
> I get the following error:
>
> Invalid relocation type!
> UNREACHABLE executed at 
> /Users/weisse4/dev/llvm/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp:89
>
> While debugging, I see that the relocation type read in 
> RuntimeDyldImpl::loadObject is 218103811, which seems corrupt to me.

Hi Weiss,

     I do not have any experience on Mach binary format, but the hex 
value of 218103811 is 0xd000003  (maybe the relocation type is 
RIT_Generic_PreboundLazyPointer = 3),  something looks like a relocation 
entry composed of "symbol index" + "relocation type".
     maybe something is wrong, that the relocation entry is not anded 
with a mask to get the final relocation type.

---
Regards,
Jiong

> Did someone encounter a similar error? Or can direct me to changes 
> that I need to do while migrating from JIT to MCJIT?
>
> Thanks.
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130409/4f65a370/attachment.html>


More information about the llvm-dev mailing list