From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 41E2B3858D37 for ; Fri, 3 Mar 2023 12:15:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 41E2B3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id EAFB530067B8; Fri, 3 Mar 2023 13:15:28 +0100 (CET) Received: by r6.localdomain (Postfix, from userid 1000) id 25FCB340215; Fri, 3 Mar 2023 13:15:28 +0100 (CET) Message-ID: Subject: Re: [PATCH v3] strip: keep .ctf section in stripped file From: Mark Wielaard To: "Guillermo E. Martinez" Cc: Nick Clifton , elfutils-devel@sourceware.org Date: Fri, 03 Mar 2023 13:15:28 +0100 In-Reply-To: <20230303024058.42stfebtruwj4t3e@kamehouse> References: <20220601155527.2192182-1-guillermo.e.martinez@oracle.com> <20230223184237.240615-1-guillermo.e.martinez@oracle.com> <20230224115125.GD9039@gnu.wildebeest.org> <20230224164838.lyfxsjbcpttxdsaf@kamehouse> <492387583758712a4f5f1f2e2646a3ba6a7a23f1.camel@klomp.org> <8367d8ae-670d-b614-d922-211dcae11250@redhat.com> <0f9fdbd9eaaa8a8e42b426d86a5aa977eef2d8e4.camel@klomp.org> <20230303024058.42stfebtruwj4t3e@kamehouse> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-3029.5 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. > >=20 > > Guillermo's patch proposes to make ".ctf" another special case > > (defaulting to keeping). > >=20 > > I am mainly wondering why binutils strip already seems to keep ".ctf" > > sections (even without -g). > >=20 >=20 > 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 wi= th > the other allocated ELF sections: >=20 > "CTF and DWARF data can coexist in the same ELF file, she said, since th= e > 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." >=20 > 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