call/link to host program function

I would like to have my IR call a function which exists in the host
program (the one which is creating the ExecutionEngine). I don't see
from the docs on Linker, ExecutionEngine, or Module how I would go about
doing this.

That is, I have a function like this in my C++ code:
  void callback( int64_t object, int32_t value );
I would like to produce IR which links back to this function and thus
can call back into the hosting code.

The IR is built at runtime in the same program hosting this function. I
use the JIT execution engine and then call runFunction.


Great! I guess this also explains why printf was working in my test
programs. I just assumed the JIT exposed libc automatically, but it
appears it links against the current symbol table.

I guess this also means the address space is actually shared. So if I
pass pointers of the functions into the JIT should it also work?