<div dir="ltr">Hi Dave,<div><br></div><div>MCJIT uses the MC layer to produce a relocatable object file for JIT'd LLVM IR. Even if you use PIC and have fully resolved all external references at the IR level this object file may still contain relocations for internal symbols which the runtime linker must resolve.<br></div><div><br></div><div>Some clients also like having the runtime linker resolve external symbols because it allows them to cache JIT'd object files are re-use them in subsequent JIT sessions.</div><div><br></div><div>Cheers,</div><div>Lang.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 22, 2015 at 8:30 PM, Dave Pitsbawn <span dir="ltr"><<a href="mailto:dpitsbawn@gmail.com" target="_blank">dpitsbawn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I wanted to know why is there a need for a runtime linker if LLVM can produce fully relocatable code?</div><div><br></div><div>That is, if I ask MCJIT to generate code that uses PC-rel offsets for everything, why would I need a runtime linker at all?</div><div><br></div><div>Is it for name resolution or something I don't get?</div><div><br></div><div>To me the JIT seems like an API that can produce assembly that I should be able to load where-ever I feel like. Only think I can think of is that if I encounter a call instruction I better have an address to give it to. But other than that ...</div><div><br></div><div>What is preventing this from happening? I'm sure it's my limited understanding of the linker space, but I would love to understand.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Dave</div></font></span></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>