Should strip discard the .ctf section ?

Nick Alcock nick.alcock@oracle.com
Tue Sep 24 14:21:00 GMT 2019


On 23 Sep 2019, Nick Clifton told this:

> Hi Nick, Hi Jose,
>
>   I wanted to raise an issue that came up at the GNU Tools Cauldron 
>   regarding the CTF debug format.  Specifically, since this is a debug 
>   format, should strip remove the .ctf section when it is removing other 
>   debug sections ?

The section is basically useless if strip removes it, so I'd vote no.
(That's the entire reason for the focus on size in CTF.)

>   What I would suggest therefore is that we add a new configure time
>   option to the binutils subdirectory that allows toolchain builders to
>   decide whether .ctf is stripped by default.  If the option is not set,
>   then the current behaviour (of not stripping it) would be retained.
>   I do not think that we need to add a new option to objcopy/strip to
>   delete the section, since users can already use --remove-section=.ctf.

My worry with adding such an option is that distributions will use it,
and if they do, they'll end up with a distro in which CTF sections are
effectively not present at all (because they're stripped into debug
packages). This would tend to make the presence of CTF sections
unreliable, so nobody would use them, so there's no point my doing any
of this at all...

Maybe I am being too cynical, though. I hope so. I don't see any reason
to object to e.g. embedded environments with extreme size restrictions
from using it, but if anyone else does it's probably a mistake (or the
CTF sections are too big and we should shrink them more!)

>   Oh, and if the toolchain is configure so that .ctf sections are 
>   removed when --strip-debug or the like are used, then --only-keep-debug
>   would definitely have to keep the .ctf section.

Oh definitely. We can't just throw it out of both and leave it nowhere!

-- 
NULL && (void)



More information about the Binutils mailing list