<div><span style="font-family:arial,sans-serif;font-size:13px">> llvm-readobj outputs the same format as readelf.</span><br style="font-family:arial,sans-serif;font-size:13px"></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">For which of readelf's options?  I didn't get too far on OS X:</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div>bin $ echo "void a(){}" | ./clang -xc -c - -o tmp.o</div><div>bin $ ./llvm-readobj tmp.o </div><div>File Format : Mach-O 64-bit x86-64</div><div>Arch        : x86_64</div><div>Address Size: 64 bits</div>

<div>LLVM ERROR: get_load_name() unimplemented in MachOObjectFile</div><div><br></div><div>-Greg</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 6, 2012 at 3:18 PM, Michael Spencer <span dir="ltr"><<a href="mailto:bigcheesegs@gmail.com" target="_blank">bigcheesegs@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Nov 6, 2012 at 2:19 PM, Marshall Clow <<a href="mailto:mclow.lists@gmail.com">mclow.lists@gmail.com</a>> wrote:<br>


> Binutils and LLVM<br>
><br>
> As part of "owning our own toolchain", various people have expressed an interest and have been working on creating various tools that duplicate the functionality of tools available on other systems.<br>
><br>
> As a start, I'd like to summarize the current status, and ask people for help updating the list.<br>
><br>
> List taken from <<a href="http://www.gnu.org/software/binutils/" target="_blank">http://www.gnu.org/software/binutils/</a>><br>
><br>
> ==============<br>
><br>
> * ld (linker) -- lld is under active development<br>
><br>
> * as (assembler) -- There is llvm-as, but it appears to be an assembler for LLVM bitcode.<br>
><br>
> * addr2line (Converts addresses into filenames and line numbers) -- ????<br>
><br>
> * ar (creates, modifies and extracts from archives) -- llvm-ar <<a href="http://llvm.org/docs/CommandGuide/llvm-ar.html" target="_blank">http://llvm.org/docs/CommandGuide/llvm-ar.html</a>> appears to do this for bitcode, object and archive files.<br>


<br>
</div>This will need major changes to handle integrating ranlib.<br>
<div class="im"><br>
><br>
> * c++filt (demangles encoded C++ symbols) -- this facility is built into libcxxabi, but I don't know of a tool that brings this out to the command-line.<br>
><br>
> * dlltool (Creates files for building and using DLLs) -- ????<br>
><br>
> * gprof (Displays profiling information) -- ????<br>
><br>
> * nlmconv (Converts object code into an Netware Loadable Module) -- ????<br>
<br>
</div>I really don't think we care about this.<br>
<div class="im"><br>
><br>
> * nm (Lists symbols from object files) -- llvm-nm does this for bitcode, object and archive files.<br>
><br>
> * objcopy (Copies and translates object files) -- ???<br>
<br>
</div>This one is hard, as translating object files between formats doesn't<br>
really make sense with modern formats. I believe the main<br>
functionality people use is converting object files to flat binaries.<br>
<div class="im"><br>
><br>
> * objdump (Displays information from object files) -- llvm-objdump appears to do this for bitcode, object and archive files.<br>
><br>
> * ranlib (Generates an index to the contents of an archive) -- There is an llvm-ranlib, but the docs at  <<a href="http://llvm.org/docs/CommandGuide/llvm-ranlib.html" target="_blank">http://llvm.org/docs/CommandGuide/llvm-ranlib.html</a>> say that it only indexes bitcode files.<br>


<br>
</div>Yep, needs object support.<br>
<div class="im"><br>
><br>
> * readelf (Displays information from any ELF format object file) -- ????<br>
<br>
</div>llvm-readobj outputs the same format as readelf.<br>
<div class="im"><br>
><br>
> * size (Lists the section sizes of an object or archive file) -- llvm-size does this for bitcode, object and archive files.<br>
><br>
> * strings (Lists printable strings from files) -- I have written a program named llvm-strings that does this, and will be submitting it as a patch shortly.<br>
><br>
> * strip (discards symbols) -- ????<br>
><br>
> * windmc (A Windows compatible message compiler) -- ????<br>
><br>
> * windres (A compiler for Windows resource files) -- ????<br>
<br>
</div>These two aren't high priority, but they are needed for a lot of MFC GUI code.<br>
<div class="im"><br>
><br>
> I'd appreciate if people with more knowledge than myself could chime in with updates to this list.<br>
><br>
> Thanks!<br>
><br>
> -- Marshall<br>
<br>
</div>So far we have solved naming collisions by making the tool work with<br>
multiple formats, however I don't feel that is the right solution for<br>
llvm-as. llvm-as/llvm-dis are very simple core tools for converting<br>
between ir formats. Extending this to object code assembly feels<br>
wrong.<br>
<br>
I think the solution to this is to move the llvm developer only tools<br>
(llc, lli, opt, as, dis, bugpoint, bcanalyzer, diff, extract, link) to<br>
the llvm tool. This would have a git like interface for accessing the<br>
subtools. The other tools remain as user tools and still support<br>
bitcode.<br>
<span class="HOEnZb"><font color="#888888"><br>
- Michael Spencer<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>