[LLVMdev] jit with external functions

Chris Lattner sabre at nondot.org
Fri Dec 8 23:53:10 PST 2006


On Fri, 8 Dec 2006, Ram Bhamidipaty wrote:
> Can I place references to external functions in the assembler files? For example
> I if my application has a function called fred() I would like to place
> calls to fred
> in the assembler text file. Can I do that and have the external function call
> resolve to the address of fred() in my application?

Yes, you can do this.  The JIT will transparently call dlsym on the main 
process to resolve external function calls.  This allows it to find 
standard lib functions like printf, it also allows your code to call into 
your own functions.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list