Readelf vs objdump

Ian Lance Taylor ian@wasabisystems.com
Wed Nov 19 05:14:00 GMT 2003


Stan Shebs <shebs@apple.com> writes:

> Hmm, I was hoping there was a stronger rationale; readelf has different
> functionality, so it's not like you can diff its output with objdump to
> confirm correctness.

That wouldn't be desirable in general.  objdump by design displays
generic information which is more or less meaningful for arbitrary
object file formats.  readelf by design displays information which is
specific to ELF.

It would be possible to add options to readelf to make it dump
information in the same format as objdump.  I don't think that would
be all that useful, though, and so far nobody has bothered to write
such code.

I do agree that it is odd that readelf has DWARF dumping code while
objdump does not.  Conversely, objdump has stabs dumping code while
readelf does not.  To me it would make more sense to have the DWARF
dumping code in objdump.  At least it should be possible to share the
DWARF dumping code between the two programs.

Ian



More information about the Binutils mailing list