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 38B52385741A for ; Tue, 23 Aug 2022 12:29:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 38B52385741A 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-587-CwgTdcp7OnG1QpfUfixhiw-1; Tue, 23 Aug 2022 08:29:02 -0400 X-MC-Unique: CwgTdcp7OnG1QpfUfixhiw-1 Received: by mail-wm1-f72.google.com with SMTP id j22-20020a05600c485600b003a5e4420552so10185098wmo.8 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=Akd+KTLYID+eMvIeAKXzjxF17hnooC8ye0YbXIIMcwS8Q4Vhkt4NrRrK4TMG1NB4wx blLpWmn8VX6Xt8WUaFaTbhvy91QYm7g+XsbyjeltxbvgGn7Ry24nyOWK6U6Z1H7sBu7r RL0ryzh6gRf5/91tW7o8BWLDMiklvDXOmAHNvpcUrjwxWXCEd/3F7ib4naIo7u0o7K+f usH/cq8Aw1PnYIkj/xzv7WhkGuyvhusEGeBJaMeoIZjV50RqfG2Dm7xOCYiWVAvbkKmI wDrqkxlPpIXwMiHXFF1Cb1H8Nld2OtRbdra81uMswm7+DXN8GWQqRw7q6ixBvM/XYjci YuXQ== X-Gm-Message-State: ACgBeo0Ekf3i67VxOzbG6Ybkwc4a6MSteJiyUeJTS9z7zxNOrHeyQu9Q R1EIE1XJjgCW3Bv1TM8msUk8aagk7FtesGQjoa1TR+113SJP3FKhGuqr67i5+4qAjVwMp2PcPlh 5uCh7AKOaTfkIepXqow== X-Received: by 2002:a05:600c:a02:b0:39d:bdf8:a4f4 with SMTP id z2-20020a05600c0a0200b0039dbdf8a4f4mr2048616wmp.201.1661257741422; 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=-3.7 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_LOW, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils 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