<div dir="ltr">Hi Bjoern,<div><br></div><div>I do not think there is any practical way to do this yourself, short of writing your own RuntimeDyld implementation.</div><div><br></div><div>The reason is that you cannot resolve a symbol to an address until you have compiled it down to an object file, but in the case of circular reference you would need to compile both IR Modules to object files before either could be patched up, and by that stage it is too late to patch either up at the IR level.</div><div><br></div><div>What is the use case for trying to resolve these references yourself, rather than letting RuntimeDyld do it for you?</div><div><br></div><div>Cheers,</div><div>Lang.</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 6, 2018 at 4:20 AM Gaier, Bjoern via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="DE" link="#0563C1" vlink="#954F72">
<div class="m_-6590352618652756621WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello everyone,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I'm still a beginner with the LLVM and the process of jitting a BC file at runtime as a JIT client - but I'm really interested into this subject.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">In my current use case I have two BC files which have cross references to each other, normally I could just add them both to the llvm::ExecutionEngine and they will be resolved.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">But I would like to resolve these cross references by myself, through the llvm::JITSymbolResolver but I see no way for this, since both files references each other.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">If I jit A, it will reach the undefined function from file B. So at this point I would have to jit B, but B references a function from A, which isn't completely resolved yet.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Is there a way to get the addresses of the functions before the jit process is completed? Maybe via the section addresses and some kind of offset or so?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Thank you for any response!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Kind greetings<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Björn<u></u><u></u></span></p>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>