This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Difference between objdump and readlelf output


On Fri, Jan 05, 2007 at 12:13:18PM +1030, Alan Modra wrote:
> 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.)

:-(

I have no idea how many people use it, but I do, and I counted on it
swapping things around.  I've frequently used both objdump and readelf
to look at a little-endian object precisely because the reversed
display was handier for some things.  Maybe the right answer is -X
which always goes the other way?

> > 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.

I'm just going to have to expect to be confused - I'll never remember
that the removed 0x means something.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]