> [Added Nick in CC.]
>
>> Hi Guillermo,
>>
>> On Mon, May 30, 2022 at 09:26:19PM -0500, Guillermo E. Martinez via 
>> Elfutils-devel wrote:
>>> Hello elfutils team,
>>> 
>>> This patch is meant to avoid remove the CTF section in
>>> stripped files.  Please let me know your thoughts.
>>>
>>> CTF debug format was designed to be present in stripped files, so
>>> this section should not be removed, so a new --remove-ctf option
>>> is added to indicate explicitly that .ctf section will be stripped
>>> out from binary file.
>>
>> First, very nice patch. My only real concern with it is that it should
>> describe how the testfile-ctf.bz2 is generated. We don't want really
>> random test binaries in the testsuite. There should be at least some
>> method to regenerate them, even if we don't automate that. See
>> e.g. tests/run-readelf-n.sh which also uses binary test files, but has
>> a little description on how each of them was generated.
>>
>> I am CCing Nick Clifton who works on binutils and annobin to check how
>> binutils strip handles this. And because we were recently discussing
>> putting some annobin data in a special section and how to indicate
>> that this section should be explicitly kept or removed. It would be
>> great if we could come to some kind of standard way of marking such
>> sections so we don't need special arguments for each such section or
>> at least have a more generic SECTION_STRIP_P macro.
>>
>> Note, that this might not be possible, these sections might be to
>> different/specific that generalizing over them is impossible. But it
>> would be good to at least try and discuss it. If only so that elfutils
>> eu-strip and binutils strip agree on how to handle/coordinate on such
>> special sections.
>
> What about using an OS-specific section flag in elf.h, something like:
>
> #define SHF_GNU_PERSISTENT 0x0ff00001 /* Section must not be stripped.  */

It now occurs to me that it would be probably better to use a less
abstract name for the flag, like SHF_GNU_NOSTRIP (I'm not that good on
naming stuff.) :)

Reply via email to