[LLVMdev] JIT question about resolving unknown function calls

Chris Lattner clattner at apple.com
Mon Jun 29 10:18:49 PDT 2009


On Jun 29, 2009, at 3:37 AM, Carter Cheng wrote:

>
> My understanding is that the JIT system allows during the running of  
> the system resolution of call instructions to undefined functions to  
> be trapped and then patched with the correct address (is this true?).

Yes, see:
http://llvm.org/docs/tutorial/LangImpl4.html#jit

> The question I have is does the current system also allow for  
> repatching? for a certain OO system I am working on this could be  
> desirable when an object/class is updated and replaced- making it  
> possible in certain cases to update the call point as the code is  
> replaced.

You can repatch a function that was hitted with the  
ExecutionEngine::recompileAndRelinkFunction method.  If you have a  
symbol that isn't JIT'd that you want to move around, just define a  
global that holds the pointer, and change the pointer as you wish.

-Chris



More information about the llvm-dev mailing list