* Using section flags to indicate strip or persistent sections [not found] ` <bug-29737-203-9tXa0aTrV2@http.sourceware.org/bugzilla/> @ 2022-11-07 11:04 ` Nick Clifton 2022-11-07 11:23 ` Florian Weimer 2022-11-07 14:06 ` Jose E. Marchesi 0 siblings, 2 replies; 4+ messages in thread From: Nick Clifton @ 2022-11-07 11:04 UTC (permalink / raw) To: guillermo.e.martinez at oracle dot com, gnu-gabi Hi Guys, We would like to suggest an extension the ELF section flags which can be used to indicate sections that should, or should not, be stripped when removing debug information. The problem we are trying to address is that different stripping tools (strip, eu-strip, llvm-strip) have different heuristics for deciding which sections should be removed when stripping debug information. In order to fix this we are proposing two new section flags: GNU_SHF_CAN_BE_STRIPPED GNU_SHF_DO_NOT_STRIP These would be set by the assembler and/or linker to indicate sections that should be removed when stripping and sections which must not be removed when stripping. It would be an error if both flags were present on a given section, and if neither flag is present then the stripping tool would fall back on its built in heuristics. In addition we need new flags for the assembler's .section directive (suggestion: 'D': can be stripped, 'K' do not strip). This email is to ask if you think that this idea has merit, and if so, are there any guidelines for writing and submitting a formal specification ? Cheers Nick ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Using section flags to indicate strip or persistent sections 2022-11-07 11:04 ` Using section flags to indicate strip or persistent sections Nick Clifton @ 2022-11-07 11:23 ` Florian Weimer 2022-11-07 14:09 ` Jose E. Marchesi 2022-11-07 14:06 ` Jose E. Marchesi 1 sibling, 1 reply; 4+ messages in thread From: Florian Weimer @ 2022-11-07 11:23 UTC (permalink / raw) To: Nick Clifton via Gnu-gabi; +Cc: Nick Clifton, guillermo.e.martinez * Nick Clifton via Gnu-gabi: > We would like to suggest an extension the ELF section flags which can be > used to indicate sections that should, or should not, be stripped when > removing debug information. > > The problem we are trying to address is that different stripping tools > (strip, eu-strip, llvm-strip) have different heuristics for deciding > which sections should be removed when stripping debug information. In > order to fix this we are proposing two new section flags: > > GNU_SHF_CAN_BE_STRIPPED > GNU_SHF_DO_NOT_STRIP > > These would be set by the assembler and/or linker to indicate sections > that should be removed when stripping and sections which must not be > removed when stripping. It would be an error if both flags were present > on a given section, and if neither flag is present then the stripping > tool would fall back on its built in heuristics. > > In addition we need new flags for the assembler's .section directive > (suggestion: 'D': can be stripped, 'K' do not strip). > This email is to ask if you think that this idea has merit, and if so, > are there any guidelines for writing and submitting a formal specification ? (Cc: list fixed, hence full quote.) I think making this explicit is a good idea in principle. However, I'm not sure if the flags convey sufficient information to decide whether a section should be removed as part of debuginfo stripping. I think that needs at least one flag that says, “this section should be removed or separated as part of default debuginfo processing”. Some use-cases involve non-removable non-allocated sections, too, but that would be something different. Thanks, Florian ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Using section flags to indicate strip or persistent sections 2022-11-07 11:23 ` Florian Weimer @ 2022-11-07 14:09 ` Jose E. Marchesi 0 siblings, 0 replies; 4+ messages in thread From: Jose E. Marchesi @ 2022-11-07 14:09 UTC (permalink / raw) To: Florian Weimer via Gnu-gabi Cc: Florian Weimer, Nick Clifton, guillermo.e.martinez > * Nick Clifton via Gnu-gabi: > >> We would like to suggest an extension the ELF section flags which can be >> used to indicate sections that should, or should not, be stripped when >> removing debug information. >> >> The problem we are trying to address is that different stripping tools >> (strip, eu-strip, llvm-strip) have different heuristics for deciding >> which sections should be removed when stripping debug information. In >> order to fix this we are proposing two new section flags: >> >> GNU_SHF_CAN_BE_STRIPPED >> GNU_SHF_DO_NOT_STRIP I think the "can be" in the GNU_SHF_CAN_BE_STRIPPED name is confusing given the indicated semantics. Wouldn't be better to call that flag GNU_SHF_STRIP instead? >> These would be set by the assembler and/or linker to indicate sections >> that should be removed when stripping and sections which must not be >> removed when stripping. It would be an error if both flags were present >> on a given section, and if neither flag is present then the stripping >> tool would fall back on its built in heuristics. >> >> In addition we need new flags for the assembler's .section directive >> (suggestion: 'D': can be stripped, 'K' do not strip). >> This email is to ask if you think that this idea has merit, and if so, >> are there any guidelines for writing and submitting a formal specification ? > > (Cc: list fixed, hence full quote.) > > I think making this explicit is a good idea in principle. However, I'm > not sure if the flags convey sufficient information to decide whether a > section should be removed as part of debuginfo stripping. I think that > needs at least one flag that says, “this section should be removed or > separated as part of default debuginfo processing”. > > Some use-cases involve non-removable non-allocated sections, too, but > that would be something different. > > Thanks, > Florian ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Using section flags to indicate strip or persistent sections 2022-11-07 11:04 ` Using section flags to indicate strip or persistent sections Nick Clifton 2022-11-07 11:23 ` Florian Weimer @ 2022-11-07 14:06 ` Jose E. Marchesi 1 sibling, 0 replies; 4+ messages in thread From: Jose E. Marchesi @ 2022-11-07 14:06 UTC (permalink / raw) To: Nick Clifton via Gnu-gabi Cc: guillermo.e.martinez at oracle dot com, Nick Clifton > Hi Guys, > > We would like to suggest an extension the ELF section flags which can be > used to indicate sections that should, or should not, be stripped when > removing debug information. > > The problem we are trying to address is that different stripping tools > (strip, eu-strip, llvm-strip) have different heuristics for deciding > which sections should be removed when stripping debug information. In > order to fix this we are proposing two new section flags: > > GNU_SHF_CAN_BE_STRIPPED > GNU_SHF_DO_NOT_STRIP > > These would be set by the assembler and/or linker to indicate sections > that should be removed when stripping and sections which must not be > removed when stripping. It would be an error if both flags were present > on a given section, and if neither flag is present then the stripping > tool would fall back on its built in heuristics. I think the "can be" in the GNU_SHF_CAN_BE_STRIPPED name is confusing given the indicated semantics. Wouldn't be better to call that flag GNU_SHF_STRIP instead? > In addition we need new flags for the assembler's .section directive > (suggestion: 'D': can be stripped, 'K' do not strip). > This email is to ask if you think that this idea has merit, and if so, > are there any guidelines for writing and submitting a formal specification ? > > Cheers > Nick ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-07 14:06 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <bug-29737-203@http.sourceware.org/bugzilla/> [not found] ` <bug-29737-203-9tXa0aTrV2@http.sourceware.org/bugzilla/> 2022-11-07 11:04 ` Using section flags to indicate strip or persistent sections Nick Clifton 2022-11-07 11:23 ` Florian Weimer 2022-11-07 14:09 ` Jose E. Marchesi 2022-11-07 14:06 ` Jose E. Marchesi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).