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.133.124]) by sourceware.org (Postfix) with ESMTPS id CBDB33858D33 for ; Fri, 3 Mar 2023 12:24:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBDB33858D33 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=1677846263; 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=imE/v37+rdhBjmGUJJqL52tT3gCpxa6+Esf7azEznEU=; b=WZ2PyRHioNKMJrPtprYEJgzbaOyoHK9gO2y0uvvsHk9aq3j031YWiCL1dWCeNC4GMJKNlz yP+m3L6u43HEKBxmwWD9wiKaJRmanDVEP3blyBLBMtDheYlyEpxj+2gwN4eyeqoiMrcBf1 n+SPAK7gEDyVuD7Zf+nwUmN+Ar3xeME= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-502-ZytoTtVBMUqOO2hOlzs1JQ-1; Fri, 03 Mar 2023 07:24:22 -0500 X-MC-Unique: ZytoTtVBMUqOO2hOlzs1JQ-1 Received: by mail-qv1-f71.google.com with SMTP id x18-20020ad44592000000b00571bb7cdc42so1292785qvu.23 for ; Fri, 03 Mar 2023 04:24:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677846261; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=imE/v37+rdhBjmGUJJqL52tT3gCpxa6+Esf7azEznEU=; b=gKprgG3FjkxnR5FaBqI4o2TzDv95ZGZlMHM/+RgvLQt9KXWwCQUnZLRDTkVJxqROVY SOaqBA/hc+it3wXvZPxnLgHa74Ebl/bxkyjLTGxv5IpPoBUgCm7oZqOjVtbpzBbfGl7a VtlA+M/Php3z6nomzmJUxmKZ84cdl0bkqJI1HBcimbFYWgAeI9ZIQTV6NYr+GnmhcRLf AhG1zrYaHYSnOgNsD98Od95OWzay38gcHUxcboCl7QaB+CedqoRkDkWC66IiyeSrApuy BBVqpUzLM4tCAAgY6JjUVqnEziNTQQvmYXc1NnEmLlWr7bIuEXOWodW8kmGEy7g/Gcg5 EcIw== X-Gm-Message-State: AO0yUKVDLuvoeA+C/tmGFpBNS9S+3FcNCVE00Eq0GzEjCmrw/w+StdK1 ckT4hWHzCAEO2+IRYuf1O4UZ8Gbu8yaQ9Z6gQhEm314pu1V0lRClAQ5M/DHBSexiJPl3Uk5VlVo L7EoR38Jl9lnH4WT2F/FBxr6haykq1yQ= X-Received: by 2002:ac8:5f93:0:b0:3bd:fd:f984 with SMTP id j19-20020ac85f93000000b003bd00fdf984mr2593208qta.2.1677846261482; Fri, 03 Mar 2023 04:24:21 -0800 (PST) X-Google-Smtp-Source: AK7set8SlieUuVikSZeea4jLrbkQRVAWkKJnhFLCdNWEbqMD41JyazsOo5QDfxZWQnlTUQY2MYwaVg== X-Received: by 2002:ac8:5f93:0:b0:3bd:fd:f984 with SMTP id j19-20020ac85f93000000b003bd00fdf984mr2593184qta.2.1677846261254; Fri, 03 Mar 2023 04:24:21 -0800 (PST) Received: from [192.168.1.18] ([79.123.86.193]) by smtp.gmail.com with ESMTPSA id t193-20020a37aaca000000b007424239e4casm1583840qke.117.2023.03.03.04.24.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Mar 2023 04:24:20 -0800 (PST) Message-ID: <8f58e4ca-16c9-4401-1985-262db0299cbb@redhat.com> Date: Fri, 3 Mar 2023 12:24:19 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v3] strip: keep .ctf section in stripped file To: Mark Wielaard , "Guillermo E. Martinez" Cc: elfutils-devel@sourceware.org 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> From: Nick Clifton In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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: Hi Mark, >>> I am mainly wondering why binutils strip already seems to keep ".ctf" >>> sections (even without -g). > 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. I think that the function that does this is "is_strip_section_1" in binutils/objcopy.c. If an input section has the BSF_DEBUGGING flag set (an internal flag to he BFD library, but basically it should be set for all debug sections, including .ctf sections I think), then the basic decision is to keep the section unless -g is used. Cheers Nick