This is the mail archive of the binutils@sources.redhat.com 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: [PATCH] Fix for readelf hex-dump SHT_NOBITS bug


Hi Marshall,

> Several days without comment or commit...  Did I violate some sort
> of patch-submitting taboo?

Nope - we are just busy is all.  Please remember that this list is
handled by volunteers who have other things to do as well.

> This looks like an obvious fix to me.  Currently, `readelf
> --hex-dump' on a SHT_NOBITS section will attempt to dump the
> section's sh_size bytes from the file (failing cleanly if the file
> is too small).  This patch makes it treat SHT_NOBITS sections as
> zero bytes in size.

Well in principle this seems like a good idea, but in practice I am
not sure that it is.  One of the purposes of the readelf tool is to be
able to display the contents of malformed ELF files in order to help
debugging.  Thus refusing to dump the contents of a non-zero sized
SHT_NOBITS section might not be such a good idea.  What if the
SHT_NOBITS attribute had been erroneously applied to the section ?

I think that it might be better to issue a warning message along the
lines of "dumping the contents of section <foo> despite the fact that
it has the SHT_NOBITS attribute".  What do you think ?

Cheers
        Nick


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