Should strip discard the .ctf section ?

Nick Alcock nick.alcock@oracle.com
Tue Oct 8 16:36:00 GMT 2019


On 7 Oct 2019, Orlando Arias told this:

> Greetings,
>
> On 10/7/19 5:03 PM, Michael Matz wrote:
>> No idea how RPM came up in this context.  It's using scripts to do all 
>> post processing and those could be changed quite easily of course.  IMO 
>> it's more about users of binutils outside of package managers that are 
>> affected by default strip behaviour.
>
> Nick Alcock brought it up as an example of why the .ctf section should
> be left by default. In fact, Nick Alcock has been talking about
> packaging systems for a while now.

Yeah. It's an example of why defaults matter and "just pass option $foo"
is not always adequate. In this case, to pass arbitrary options to
strip, I'd need to fix both RPM and I suspect debhelper first, since
they have no way to pass such options in without e.g. patching the thing
at runtime (which is possible, at least for RPM, but horrific and not
something anybody should be asked to do).

>> It all comes down to one question: how should strip be told to not strip 
>> .ctf? (a) via command line option, or (b) via existence of .ctf?  Both are 
>> equivalent, because existence of .ctf implies a command line option to the 
>> compiler, ergo an explicit request by the user.  Requiring a separate 
>> command line option for strip in addition seems just pointless.
>
> DWARF debug sections are only created if the compiler/assembler is told
> to create them.

Yes, but *configure's default is to create them*. i.e., if the builder
of autoconfiscated packages does nothing unusual, they get debuginfo.
That is something that is unlikely to be true of CTF for a long time, if
ever. In a very real sense -g -O2 is 'the default' for a large subset of
packages.

> On 10/5/19 3:40 PM, Nick Alcock wrote:
>> Stripping it out by
>> default will *always* be a choice that annoys the user, until -gt is
>> turned on by default, which is not something I would expect to happen
>> until CTF becomes widely used.
>
> So, assuming that CTF becomes widely used, the moment that -gt becomes a
> default in Autoconf scripts, we now have to change the way strip works
> to remove the section since it is automatically added whenever building?

If it's become widely used, it seems to me that surely you wouldn't want
to do that, because it would break things. That's what "wide use" *means*.



More information about the Binutils mailing list