This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Fix for readelf hex-dump SHT_NOBITS bug
- From: Nick Clifton <nickc at redhat dot com>
- To: "Marshall T. Vandegrift" <llasram at wuli dot nu>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 30 Oct 2003 10:12:08 +0000
- Subject: Re: [PATCH] Fix for readelf hex-dump SHT_NOBITS bug
- References: <87u15zqr48.fsf@wuli.nu> <87smlcpvjf.fsf@wuli.nu>
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