I’m part of a team at Intel that works on implementing the MC-JIT execution path for ELF objects with built-in support for debugging the JITted code with GDB. We currently have a working implementation passing all ExecutionEngine tests on MC-JIT for ELF, as well as several proprietary workloads. The current implementation focuses on Linux, although with some trivial modifications it can also be made to work on Windows (pending on some changes to Triple, as discussed in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-January/046583.html).
I was granted “commit after approval” rights to the repo by Chris Lattner, and will start delivering patches to llvm-commits today. To make the review process manageable, we intend to split the patches into a few incremental parts:
Modifications (more precisely, extension) to ELFObjectFile (from libObject) to support dynamic loading
Implementation of MC-JIT for ELF, including a new RuntimeDyldELF class (that parallels the existing RuntimeDyldMachO) which implements the dynamic loading of the ELF image into memory, its relocation and execution.
An implementation of a MC-JIT – GDB bridge which allows to fully debug the JITted code with GDB.
These patches will be a superset of an earlier patch sent by Daniel Malea (http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20111219/133702.html).
We’ll be very happy to have the patches reviewed, and see a functional MC-JIT implementation for ELF in LLVM trunk soon.