llvm-mc ELF, macho PEcoff

Hi!

I think llvm-mc did amazing work and I'm stunned ;). - So I start
reading source-code and making notes.
To my question: At which state is the disassembly for PEcoff or ELF?

I read the blog (Intro to the LLVM MC Project - The LLVM Project Blog):
"""
The MC components have been designed to be object file independent
(e.g. work for MachO, ELF, PE-COFF etc) but only have an
implementation for MachO (used on Mac OS/X systems). Adding support
for ELF and/or PE-COFF should be reasonably straight-forward.
"""
I don't even see the MachO support. macho-dump only dumps Macho header
information.It doesn't seem to do much more. I'm on svn 121904. Could
someone fill me in on how to selectively disassemble something with
this undocumented tool-chain. I'd like to see support for binary
contains, but I cannot find proper references about what has already
been done.

Thanks,
Marius

Hi!

I think llvm-mc did amazing work and I'm stunned ;). - So I start
reading source-code and making notes.
To my question: At which state is the disassembly for PEcoff or ELF?

I read the blog (Intro to the LLVM MC Project - The LLVM Project Blog):
"""
The MC components have been designed to be object file independent
(e.g. work for MachO, ELF, PE-COFF etc) but only have an
implementation for MachO (used on Mac OS/X systems). Adding support
for ELF and/or PE-COFF should be reasonably straight-forward.
"""
I don't even see the MachO support. macho-dump only dumps Macho header
information.It doesn't seem to do much more. I'm on svn 121904. Could
someone fill me in on how to selectively disassemble something with

For ELF? I'd use binutils/objdump targeted for the arch u are looking at.

this undocumented tool-chain. I'd like to see support for binary
contains, but I cannot find proper references about what has already
been done.

It depends on the architecture. For example, ARM ELF direct .o
emission is coming together but it is incomplete.
ARM .s -> .o still has a lot of warts.
X86 is more mature.

llvm-mc cannot read object files. I am currently working on generic
object file support; however, it is not fully in tree yet, and even
then it's not a complete API yet. It currently includes a nm and
objdump -d clone.

See: http://llvm.org/devmtg/2010-11/ Object Files in LLVM
And: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20101108/111581.html

- Michael Spencer