[LLVMdev] lli external functions

Daniel Dunbar daniel at zuster.org
Tue Feb 19 10:44:23 PST 2008


I find the behavior of lli (in --force-interpreter mode) rather strange when calling external
functions. Currently if a function has not been defined in the internal "known external"
function table it just tries to resolve the symbol and cast it to its generic external function
type. 

Is this really the intended behavior? This is most likely to cause the interpreter to crash 
without warning when it calls the function. The only use case seems to be if a user wants
to explicitly extend the interpreter by providing a loadable module of functions that expect
to be called in this fashion, but that doesn't seem very common (and is undocumented?).
It seems like it would make more sense for the interpreter to just give up and report an
error to the user (or at least give a warning that it is calling into arbitrary binary code).

In any case, it seems like lli should know how to call memmove. Patch attached.

 - Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lli-memmove-support.patch
Type: application/octet-stream
Size: 1269 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080219/ee149b78/attachment.obj>


More information about the llvm-dev mailing list