Hi Guillermo,

On Thu, 2023-03-02 at 20:40 -0600, Guillermo E. Martinez wrote:
> On Tue, Feb 28, 2023 at 03:27:13PM +0100, Mark Wielaard wrote:
> > There are some exceptions to the general rule in eu-strip of dropping
> > not referenced, non-allocated, SHT_PROGBIT sections. SHT_NOTE sections
> > are never removed (even if they aren't allocated), as are non-
> > SHT_PROGBIT sections. ".gnu.warning." sections also aren't (even if
> > they are non-allocated SHT_PROGBIT sections). And ".comment" sections
> > aren't if not explicitly told to.
> > 
> > Guillermo's patch proposes to make ".ctf" another special case
> > (defaulting to keeping).
> > 
> > I am mainly wondering why binutils strip already seems to keep ".ctf"
> > sections (even without -g).
> > 
> 
> I'm not plenty sure, but I can tell that it was done so, because CTF was
> designed having in mind a lightweight debug format being shipped along with
> the other allocated ELF sections:
> 
>       "CTF and DWARF data can coexist in the same ELF file, she said, since 
> the
>       CTF data has its own dedicated section. The CTF data is naturally
>       smaller, but the format also includes compression to reduce the size
>       requirements further. The result is that this data, unlike DWARF
>       information, need not be stripped to get the executable file down to a
>       reasonable size."
> 
> https://lwn.net/Articles/795384/

Right. But I am wondering how that mechanism works with binutils strip.
Apparently we do something different in eu-strip which makes it
necessary to add a --keep-ctf option based on the section name. It
would be good if we figured out how/what we can do to keep the
different strip utilities in sync.

Cheers,

Mark

Reply via email to