Hi Nick, On Tue, 2023-02-28 at 12:59 +0000, Nick Clifton wrote: > > O, this surprises me. I wasn't aware binutils strip keeps unallocated > > sections by default. But apparently it does. It doesn't seem specific > > to ".ctf". Do you know why? This seems counter to how strip is supposed > > to behave, at least how I understand it. > > Actually thinking about it, there are a few important un-allocated sections > that ought to be kept in a binary. For example .gnu_debuglink and .shstrtab. > So maybe deleting unallocated sections by default is not such a good idea.
Sure, but both are those are actually added or rewritten during stripping. 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). Cheers, Mark