[LLVMdev] disassembly/decompiling

Reid Kleckner rnk at mit.edu
Mon Oct 26 19:57:40 PDT 2009


> Another obvious next step would be to allow re-compiling one platform's
> binaries to run on another CPU architecture. For most POSIX-based OSes it
> would only require a thin wrapper library to map the runtime environment from
> one platform to the other. Going down this direction would kind of reduce the
> need for the Fat-ELF project underway; if you can easily retarget a binary
> from one platform to another there's no reason to ship multiple binary formats
> in a single executable/object file.

How would one deal with things like sizeof(void *) being different on
different platforms, or platform-specific hacks in preprocessor
conditionals?  I suppose you could use that thin POSIX wrapper to pass
the MAP_32BIT (at least on Linux) to mmap, and then what you're really
getting is not the 64-bit address space, but the extra registers and
target-specific optimizations.

I'm pretty there aren't plans to use llvm-mc to disassemble binaries
to LLVM IR.  Recently some folks were discussing other ways of doing a
similar x86 -> LLVM translation on this list, though, so you might
check the archives.

Reid



More information about the llvm-dev mailing list