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 EAB873814FD8 for ; Tue, 7 Jun 2022 13:23:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EAB873814FD8 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-SxLuI5ClOwWMHtGm0YDxSw-1; Tue, 07 Jun 2022 09:23:34 -0400 X-MC-Unique: SxLuI5ClOwWMHtGm0YDxSw-1 Received: by mail-wr1-f69.google.com with SMTP id p10-20020adfaa0a000000b0020c4829af5fso3906499wrd.16 for ; Tue, 07 Jun 2022 06:23:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject:content-transfer-encoding; bh=BQQl68GRWZBwZYq5oknXPMeYugV0XqONkbh8rDCj5HI=; b=gDVw9P/ywTihyTZzycbtWE+7vP9oY8vjM5lkdFlqmgTh53jjs3ldSPHx1Ysk+AI5zB RPvB3Wz7O9AfW/+L86RGn7xs1S/er6/SEH9JOBrE5E0OQXrqI1KaZsrJ94p//PxAo8Ku Xw8cKbTZCgeuna4TZU+Z4K3vmLYKZmJfO7ngEQcpOvYxccXe6GYAI1GIhalSciirWbgl gTGkxxBc22EqXBDPd73nBqjiKtS/bUj/QB0lzTu70CgFxlJEms5hwqSeWVs+EZE+r9Bf /9DOrleab4tgkArdgmfWO+lRU15qzNxsd5w3xahqy1bLkoDUG14qodG2zLee1MF0kVCw dKeQ== X-Gm-Message-State: AOAM532KnyEhXX+ucJS0CWCuuQoKoiDkeCTQ7WpLgBb1pUEDtP9M4e4A 3CNhXH++3UyNdqKDwfZX3ubO8D4/lepZhOIOkR04rJ4OKviheS/mFijR72HWsZ6VcerydjEbX9u QM0ngQnVKwYJKjOP8cbP1oFeelztzT3FidazDCSPMgeuhN4qkSzTP6h15CwEytRURKKq2454Pmw == X-Received: by 2002:a05:600c:acb:b0:397:bdb:ffea with SMTP id c11-20020a05600c0acb00b003970bdbffeamr28896066wmr.56.1654608213334; Tue, 07 Jun 2022 06:23:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIw8DQkB707kZN5tLwzwZsIjQOB1BG7p1h1Efer8KteGYr/xaV57ySwHvMZXjSudE8KNMVeA== X-Received: by 2002:a05:600c:acb:b0:397:bdb:ffea with SMTP id c11-20020a05600c0acb00b003970bdbffeamr28896040wmr.56.1654608213033; Tue, 07 Jun 2022 06:23:33 -0700 (PDT) Received: from [192.168.1.6] (adsl-2-solo-173-39.claranet.co.uk. [80.168.173.39]) by smtp.gmail.com with ESMTPSA id y9-20020a5d6209000000b00215cba84a89sm11225971wru.64.2022.06.07.06.23.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jun 2022 06:23:32 -0700 (PDT) Message-ID: <851429fd-cb43-f0a8-3db1-6c10587c82fa@redhat.com> Date: Tue, 7 Jun 2022 14:23:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 To: elfutils-devel@sourceware.org, "Jose E. Marchesi" , Mark Wielaard From: Nick Clifton Subject: Re: [PATCH] strip: keep .ctf section in stripped file X-Mimecast-Spam-Score: 1 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=-4.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2022 13:23:37 -0000 Hi Guys, I apologise - I know that Jose CC'ed me on this topic, but I have lost the email, so I am creating this post instead. > What about using an OS-specific section flag in elf.h, something like: > > #define SHF_GNU_PERSISTENT 0x0ff00001 /* Section must not be stripped. */ I rather like this idea. It would certainly make things easier. Assuming that is that there is a convenient way to set the flag. Ie we need to teach the assembler about it, and probably the linker too (so that it can be used in linker scripts). It might also be a nice idea to have a complimentary flag to indicate sections that expect to be stripped, even if they might otherwise be retained. For example: #define SHF_GNU_TREAT_AS_DEBUG 0x0ff00002 /* Treat as a debug info section. Strip with other debug sections and move to a separate debug info file when creating such files. */ This could be added to note sections for example, where the notes will not be needed at run-time. Cheers Nick