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 695D13858C50 for ; Tue, 23 Aug 2022 12:29:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 695D13858C50 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-618-3ytaJqhwOUCsHFpmY89jlA-1; Tue, 23 Aug 2022 08:29:02 -0400 X-MC-Unique: 3ytaJqhwOUCsHFpmY89jlA-1 Received: by mail-wm1-f72.google.com with SMTP id n1-20020a7bc5c1000000b003a682987306so285741wmk.1 for ; Tue, 23 Aug 2022 05:29:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=bnUL+Xuc6jmMYe+OyTIdwwzPEin0sj6DuhDyTVT3KK8=; b=3a05+0iMRozSB8hfaDSwkv635GOwBtwVt9G5cO0jM5NTQK1EWTRQ5RZlY/QW3si1R1 nTxzb3yTPJ5SkzGvr/qrRU6OhukaPlzj/+a543XpSChb0ITzqmfEtp0ELWYidYtBRy23 +1qUJh6EldeaOnQtp7/oouiniOJc0pqSr8n1noL5vfhG3hoROVvLJ3QwGlQWRnJUi1p5 nUFc61rqus2qcGx3iJYsaXuC26Uz1zXw8oePhbUUIhZeRq2FJXL//odDUcemLlRW7nld tYVDO7dtlpDs18uad+Pri/vClFlp2IEB8QAl4NyXhD1cz3GMj3QkEbovGZ/HsWaEgddg nFUA== X-Gm-Message-State: ACgBeo3YgyNH1fZJYPeGSe73JSq/+BQttM3DPwJMIScpwHn3EX35qPmA rX4dJ/nkyQq0WPSqNBBgwAWHfGolQ3Wyq0HMcW/46q+W0xOA2EvC4mWi7sNxs+GpopEz6U3dmnn aKsW34gu9ESGGcUbAXEm3 X-Received: by 2002:a05:600c:a02:b0:39d:bdf8:a4f4 with SMTP id z2-20020a05600c0a0200b0039dbdf8a4f4mr2048620wmp.201.1661257741446; Tue, 23 Aug 2022 05:29:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR6OaBPja3Sv9fRbjg4s6p//6X5biEv915LB0sPuiADxiUFwDizMOTIsxNYXyAPahzlGc82nFg== X-Received: by 2002:a05:600c:a02:b0:39d:bdf8:a4f4 with SMTP id z2-20020a05600c0a0200b0039dbdf8a4f4mr2048599wmp.201.1661257741211; Tue, 23 Aug 2022 05:29:01 -0700 (PDT) Received: from [192.168.1.6] (adsl-2-solo-236-177.claranet.co.uk. [80.168.236.177]) by smtp.gmail.com with ESMTPSA id v2-20020a5d6b02000000b0021e30e9e44asm13803178wrw.53.2022.08.23.05.29.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Aug 2022 05:29:00 -0700 (PDT) Message-ID: <9e531668-7cc7-ef01-a74a-07cd19c289c5@redhat.com> Date: Tue, 23 Aug 2022 13:28:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 To: Florian Weimer , binutils@sourceware.org Cc: gcc@gcc.gnu.org, libc-alpha@sourceware.org References: <87fshn2mu1.fsf@oldenburg.str.redhat.com> From: Nick Clifton Subject: Re: Counting static __cxa_atexit calls In-Reply-To: <87fshn2mu1.fsf@oldenburg.str.redhat.com> 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=-2.6 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, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2022 12:29:05 -0000 Hi Florian, > What would be the most ELF-flavored way to implement this? After the > final link, I expect that the count (or counts, we need a separate > counter for thread-local storage) would show up under a new dynamic tag > in the dynamic segment. This is actually a very good fit because older > loaders will just ignore it. But the question remains what GCC should > emit into assembler & object files, so that the link editor can compute > the total count from that. (It would worthwhile asking this question of the LLVM community too, since ideally we would like to use the same method in both compilers). This sounds like an opportunity to add a couple of new GNU object attributes: .gnu_attribute Tag_gnu_destructor_count, .gnu_attribute Tag_gnu_tld_count, Which would then translate into a GNU object attribute notes in the object file. Cheers Nick