From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id D6E373857C44 for ; Mon, 7 Nov 2022 11:23:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D6E373857C44 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667820205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tO6Y6MBv8XByO4AMeQaajp0xUnu93IOcUsDXhIK8XPE=; b=gulkK8b1Ed2Zfoapo54DkDda/bqoe81U2xaIZlRGdw3IM/A2e+7GuZIMKOpNqDFHiwmYam 4yYaEkLF3TOoGDRbYPfvoNLx8oZxAo/emDichBb4+WIxk0/N8qcpOBcW2RivUnoVZWVGz1 gRDU4vqjSQ9J2f3dpoymf4lDxv3g+pM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-497-Ubs1CBo4Nza1bNNGdBGegA-1; Mon, 07 Nov 2022 06:23:24 -0500 X-MC-Unique: Ubs1CBo4Nza1bNNGdBGegA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EBE6D3810794; Mon, 7 Nov 2022 11:23:23 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.86]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E86852027063; Mon, 7 Nov 2022 11:23:22 +0000 (UTC) From: Florian Weimer To: Nick Clifton via Gnu-gabi Cc: Nick Clifton , guillermo.e.martinez@oracle.com Subject: Re: Using section flags to indicate strip or persistent sections References: <511c27ce-7b04-ea2d-9a62-a110f1f11d87@redhat.com> Date: Mon, 07 Nov 2022 12:23:21 +0100 In-Reply-To: <511c27ce-7b04-ea2d-9a62-a110f1f11d87@redhat.com> (Nick Clifton via Gnu-gabi's message of "Mon, 7 Nov 2022 11:04:45 +0000") Message-ID: <87iljrknyu.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Nick Clifton via Gnu-gabi: > We would like to suggest an extension the ELF section flags which can b= e > 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 presen= t > 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 specificat= ion ? (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, =E2=80=9Cthis section should be removed = or separated as part of default debuginfo processing=E2=80=9D. Some use-cases involve non-removable non-allocated sections, too, but that would be something different. Thanks, Florian