edA-qa mort-ora-y
2013-Oct-06 13:25 UTC
[LLVMdev] how to runtime link to shared library symbols in the JIT?
I would like to load shared libraries at runtime for use in some JIT'd code. I can't find much about how the JIT resolves symbols, so can somebody answer a few questions for me? 1. Will the symbols from a dlopen'd library with RTLD_GLOBAL be available? In this case I can manually dlopen the libraries prior to the JIT run. 2. Can I derive from ExecutionEngine and override the getPointerToNamedFunction method? If so, does this just return the C/ABI pointer to the function? What is the equivalent for data variables? 3. Is the same basic model available on Windows using DLLs? I really don't have any experience there yet. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 263 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131006/c2874ace/attachment.sig>
Yaron Keren
2013-Oct-06 15:02 UTC
[LLVMdev] how to runtime link to shared library symbols in the JIT?
On Windows DLLs loaded with llvm::sys::DynamicLibrary::LoadLibraryPermanently() are available to the JIT and MCJIT. I guess this should work with other OS. Yaron 2013/10/6 edA-qa mort-ora-y <eda-qa at disemia.com>> I would like to load shared libraries at runtime for use in some JIT'd > code. I can't find much about how the JIT resolves symbols, so can > somebody answer a few questions for me? > > 1. Will the symbols from a dlopen'd library with RTLD_GLOBAL be > available? In this case I can manually dlopen the libraries prior to the > JIT run. > > 2. Can I derive from ExecutionEngine and override the > getPointerToNamedFunction method? If so, does this just return the C/ABI > pointer to the function? What is the equivalent for data variables? > > 3. Is the same basic model available on Windows using DLLs? I really > don't have any experience there yet. > > > > -- > edA-qa mort-ora-y > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > Sign: Please digitally sign your emails. > Encrypt: I'm also happy to receive encrypted mail. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131006/e514a7c5/attachment.html>