[llvm-dev] [ORC JIT] -Resolving cross references in a multi-process scenario

Gaier, Bjoern via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 6 05:24:05 PST 2020

Hello LLVM-Mailing-List and Lang,

I have a very weird (or strict?) scenario and was curious if the ORC  JIT can help me with it. Soo here it comes:

I have currently a windows process ("Runtime") which does nothing but creating a shared memory with read, write and execute rights - and also writing some function addresses like from printf to it.
Then I have two or more processes which are using the ORC JIT to load modules to this shared memory, in "perspective" of the process I mentioned above ("Runtime"). The sections are remapped from the other processes to be correct for "Runtime", also they resolve the undefined references for "Runtime" - like for printf and so on.
This works quite well so far! Wuhuhu x3

However, there is one issue about it. Given that those two (or more processes) are now loading modules that reference each other. Like Module A is using a function of Module B - but Module B also uses a function of Module A. How could I resolve those modules when they are loaded from different processes? Normally I would use llvm-link to link those modules but in my current scenario this is sadly not possible.

Can the ORC JIT help me with that? Can I solve this problem differently? Like replacing all the functions of Module A that rely on Module B with function pointers? Is something like that possible?

I know this situation is pretty uncommon but sadly I ran into that issue.

Kind greetings
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200306/64d45798/attachment.html>

More information about the llvm-dev mailing list