[LLVMdev] LLVM and dynamic binary translator

Tilmann Scheller tilmann.scheller at googlemail.com
Tue Sep 30 01:52:27 PDT 2008


On Mon, Sep 29, 2008 at 12:52 PM, Matthijs Kooijman
<m.kooijman at student.utwente.nl> wrote:
>> 1. Can LLVM be used in a dynamic binary translator? Dynamic translator
>> translators target code for an architecture (say PPC) to host code (say x86)
>> and execute it.
> There has been some discussion about this within the past two months on this
> list, IIRC. You should try searching the archives for that discussion.
Yes, dynamic binary translation with LLVM is absolutely possible, for
more information I suggest taking a look at the thread at
http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-April/013689.html

> IIRC, the outcome is that transforming binary code into LLVM IR is very, very
> tricky, and almost impossible to do right for any possible input binary.
>
> Others can problem comment a bit more on the topic, I'm just repeating what I
> heard other people say on this list :-)
Actually if you have a "frontend" which converts from source machine
code to some IR which can be easily mapped to LLVM IR, then it's not
too difficult (IIRC I had the first running version of llvm-qemu in
about 3 weeks, without any prior LLVM knowledge and only minor
knowledge about qemu).

AFAIK someone else is working on a translator which directly goes from
x86 to LLVM IR, not sure about the current state though.

Greetings,

Tilmann



More information about the llvm-dev mailing list