<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">于 2013/4/9 21:08, Weiss, Eran 写道:<br>
</div>
<blockquote cite="mid:CD89ED6C.5162%25eran.weiss@emc.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div>Hi,</div>
<div><br>
</div>
<div>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.</div>
<div>When I try to use MCJIT I encounter a problem with
relocations of external symbols – functions compiled statically
beforehand with gcc.</div>
<div><br>
</div>
<div>I get the following error:</div>
<div><br>
</div>
<div>
<div>Invalid relocation type!</div>
<div>UNREACHABLE executed at
/Users/weisse4/dev/llvm/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp:89</div>
</div>
<div><br>
</div>
<div>While debugging, I see that the relocation type read in <span
class="Apple-style-span" style="font-family: Menlo; font-size:
11px; ">RuntimeDyldImpl::loadObject</span> is 218103811, which
seems corrupt to me.</div>
</blockquote>
<br>
Hi Weiss,<br>
<br>
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".<br>
maybe something is wrong, that the relocation entry is not anded
with a mask to get the final relocation type.<br>
<br>
---<br>
Regards,<br>
Jiong<br>
<br>
<blockquote cite="mid:CD89ED6C.5162%25eran.weiss@emc.com"
type="cite">
<div>Did someone encounter a similar error? Or can direct me to
changes that I need to do while migrating from JIT to MCJIT?</div>
<div><br>
</div>
<div>Thanks.</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>