[PATCH] readelf: Warn zero-sized relocation sections

Hans-Peter Nilsson hp@bitrange.com
Wed Apr 22 02:51:38 GMT 2020


On Tue, 21 Apr 2020, Jan Beulich wrote:
> On 21.04.2020 12:01, Nick Clifton wrote:
> > I have been thinking about this.  I was wondering what the best form
> > of such an option would be.  I see three different possibilities:
> >
> >   * Just warn about everything, and do not have an option.

(Not this one.)

> >   * Have a --enable-warnings option which is off by default
> >     and which disables *all* warnings unless enabled.
> >     This would mean changing the current behaviour of readelf...

Hm; regarding "--enable-*".  I don't mind the names, but you're
not going to make these *configure-time* options, right?

> >
> >   * Have a --enable-extra-warnings option which enables the zero
> >     sized section test but no others.  (For now - in the future
> >     I would envision us adding more tests).  For this path I
> >     think that it would also make sense to warn about any zero
> >     sized section that does not have the SHT_NOBITS type.
>
> Of the three I'd vote for the last,
[...]

> > Or maybe:
> >
> >   * Have a --enable-lint (or some such name) which enables testing
> >     for conformance to the ELF standard, (plus strangeness things
> >     like zero sized sections).  This would count as a command option
> >     in its own right, so that unless another option is provided
> >     then only the warning/error messages would be displayed.
>
> Perhaps this one's best, albeit -
[...]

Agree with what Jan wrote (including what I pruned).

brgds, H-P


More information about the Binutils mailing list