[LLVMdev] Binary translation to LLVM bitcode

Nicolas Geoffray nicolas.geoffray at lip6.fr
Thu Jun 12 13:59:56 PDT 2008


Christian Plessl wrote:
> I'm looking for methods for generating LLVM bitcode from binaries  
> (binary translation). I found two projects that seem to be related:  
> vmkit and llvm-qemu
>
> a) Could someone shed some light on how the recently released vmkit  
> works? 

vmkit is two things. First, it translates JVM and MSIL bytecodes to LLVM 
IR. Second, it is a runtime environment  for Java apps (a JVM) or .Net apps.
 
> Can vmkit be used for statically translating JVM or MSIL code  
> to LLVM bitcode? 

Yes it could. It would require to rewrite the JVM/MSIL to LLVM IR 
translator as a library (following the LLVM philosophy). The resulting 
LLVM bitcode file will however need a runtime environment for runtime 
calls (e.g. malloc) and Java/C# class references.

> Or is vmkit simply reusing LLVM's JIT execution  
> engine, without ever generating LLVM bitcode?
>   

To use LLVM's JIT execution engine, one needs to emit LLVM bitcode.

Good luck!
Nicolas

> b) What is the state of llvm-qemu (http://code.google.com/p/llvm- 
> qemu/)? Could llvm-qemu be used for binary translation of x86 binaries  
> to LLVM bitcode?
>
> I would appreciate any comment.
>
> Best regards,
>   Christian
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>   




More information about the llvm-dev mailing list