Difference between objdump and readlelf output

Alan Modra amodra@bigpond.net.au
Fri Jan 5 01:43:00 GMT 2007


On Thu, Jan 04, 2007 at 09:52:03AM -0500, Daniel Jacobowitz wrote:
> On Thu, Jan 04, 2007 at 11:21:37PM +1030, Alan Modra wrote:
> > 	* readelf.c (dump_section): Don't print 32-bit values, which
> > 	were done incorrectly for little-endian.  Instead print bytes.
> 
> I've actually found the existing behavior useful.  It's not reversing
> 32-bit values - the entire line is reversed, so you have to read it
> right to left, but it's easy to make out 64-bit words.

I think that reversing the entire line was just plain weird.  (And I
suspect that not many people use readelf -x, otherwise we probably
would have seen a bug report about it before now.  I find objdump -s
-j<section name> easier to use than readelf -x<section number>, so
much so that I'd only use readelf -x when there were duplicate
section names.)

> If you're going to reverse the order, can there be some sort of header
> indicating what it's printing?  Because otherwise we'll have two
> versions of readelf producing similar looking output in the opposite
> order.

Um, I committed the patch as is.  Would removing the leading "  0x" on
the address be enough of an indicator for you?  That would make the
section contents dump the same as objdump -s.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list