[LLVMdev] LLVM linkage error - Program used external function 'foo' which could not be resolved!

Charlie Turner charlesturner7c5 at gmail.com
Tue Jan 6 13:15:42 PST 2015


On 6 January 2015 at 21:00, mahesh ravishankar
<mahesh.ravishankar at gmail.com> wrote:
> sys::DynamicLibrary::AddSymbol("foo",(void*)foo);

This solution could be suitable to your needs, but it's also possible
you'll run into name conflict problems.

An alternative approach is to subclass SectionMemoryManager and
override the getSymbolAddress function to search for the passed-in
name in all modules previously loaded, not just the current "open"
module.

An example of the latter approach that might be of interest to you is
on the LLVM blog,
http://blog.llvm.org/2013/07/using-mcjit-with-kaleidoscope-tutorial.html

HTH,
Charlie.



More information about the llvm-dev mailing list