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 407DF3858D33 for ; Tue, 28 Feb 2023 14:27:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 407DF3858D33 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 37D7830067AD; Tue, 28 Feb 2023 15:27:15 +0100 (CET) Received: by r6.localdomain (Postfix, from userid 1000) id E436E3401F8; Tue, 28 Feb 2023 15:27:13 +0100 (CET) Message-ID: <0f9fdbd9eaaa8a8e42b426d86a5aa977eef2d8e4.camel@klomp.org> Subject: Re: [PATCH v3] strip: keep .ctf section in stripped file From: Mark Wielaard To: Nick Clifton , "Guillermo E. Martinez" Cc: elfutils-devel@sourceware.org Date: Tue, 28 Feb 2023 15:27:13 +0100 In-Reply-To: <8367d8ae-670d-b614-d922-211dcae11250@redhat.com> 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> 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.6 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,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 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. >=20 > Actually thinking about it, there are a few important un-allocated sectio= ns > that ought to be kept in a binary. For example .gnu_debuglink and .shstr= tab. > 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