[LLVMdev] ELF / COFF Summary

Reid Spencer reid at x10sys.com
Wed Jun 15 22:35:09 PDT 2005


We've had various discussions about ELF/COFF support in LLVM. Here's a
summary and action plan.

1. Do we need a "reading" interface?
      * Reid: No
      * Alexander: Yes
      * Chris: No
      * Jeff: We already have this in lib/System (DynamicLibrary.h)

2. Do we support just .so/.exe or all object formats?
      * Reid: Just .so/.dll .exe and .o
      * Alexander: Just .so/.dll
      * Chris: Just .so/.dll and .o
      * Jeff/Chris/Alexander: emitting both .o and .so/.dll eliminates
        the need for a native assembler or gas which is important for
        Win32 because it doesn't distribute with an assembler. This is
        also important for compiler writers as it reduces dependencies
        on other software packages and makes the compilation process
        faster. 

3. Should the level of abstraction (LOA) to object code interface be
something along the lines of "add function" or "add global var"?
      * Alexander: yes
      * Chris: no, make it more abstract. create a template class whose
        parameter is an object file writer that the various targets can
        use to implement a new TargetMachine::addPassesToEmitObject

4. Do we want to expose arbitrary construction of ELF/COFF?
      * Reid: no
      * Alexander: no
      * Chris: no, keep ELF/COFF implementations separate

So, here's the plan:

1. No reading interface. To have a system agnostic interface for reading
a dynamic library, use System/DynamicLibrary. No plans for reading a
native object file for any kind of examination purpose (at least, not
for a long while).

2. We will support .so/.dll and .o/.obj file output. There will be no
support for .exe or .a output.

3. The interface will deal with ELF and COFF output separately with
separate interfaces for them.

4. If Chris will expound on his design for the way to implement
TargetMachine::addPassesToEmitObject, that sounds like a good way to go.
However, doesn't this mean the ELF/COFF interfaces should be at the same
level? I'm looking at the X86/X86CodeEmitter.cpp file and the various
methods for emitting instructions/blocks/addresses/etc. Shouldn't the
ELF/COFF interfaces be somewhat similar?  

5. I have libELF building under LLVM. Its in lib/ObjCode/ELF (new).
Should I commit it?

Reid. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050615/29bb594c/attachment.sig>


More information about the llvm-dev mailing list