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 16BA43985479 for ; Fri, 27 May 2022 12:43:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 16BA43985479 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-92-r5FesgpoNDaONkgmd8HcNA-1; Fri, 27 May 2022 08:43:37 -0400 X-MC-Unique: r5FesgpoNDaONkgmd8HcNA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 39E1E185A7A4; Fri, 27 May 2022 12:43:37 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 12530492C3B; Fri, 27 May 2022 12:43:35 +0000 (UTC) From: Florian Weimer To: Wilco Dijkstra Cc: "H.J. Lu" , Wilco Dijkstra via Libc-alpha , Szabolcs Nagy Subject: Re: [PATCH 2/3] Revert "[AArch64][BZ #17711] Fix extern protected data handling" References: <87mtf5wk0k.fsf@oldenburg.str.redhat.com> <8735gwhz9i.fsf@oldenburg.str.redhat.com> Date: Fri, 27 May 2022 14:43:34 +0200 In-Reply-To: (Wilco Dijkstra's message of "Thu, 26 May 2022 20:03:02 +0000") Message-ID: <878rqnf8nd.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 2.85 on 10.11.54.9 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=-4.9 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: 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: Fri, 27 May 2022 12:43:41 -0000 * Wilco Dijkstra: > Hi Florian, > > Sure, something basic like this shows the issues: > > int x; > int f(void) { return ++x; } > int main(void) { return f(); } > > compile with -O2 -fPIC -flto -shared: > > 00000000000004f0 : > =C2=A04f0: =C2=A0 b0000090 =C2=A0 =C2=A0 =C2=A0 =C2=A0adrp =C2=A0 =C2=A0x= 16, 11000 <__cxa_finalize@GLIBC_2.17> > =C2=A04f4: =C2=A0 f9400611 =C2=A0 =C2=A0 =C2=A0 =C2=A0ldr =C2=A0 =C2=A0 x= 17, [x16, #8] > =C2=A04f8: =C2=A0 91002210 =C2=A0 =C2=A0 =C2=A0 =C2=A0add =C2=A0 =C2=A0 x= 16, x16, #0x8 > =C2=A04fc: =C2=A0 d61f0220 =C2=A0 =C2=A0 =C2=A0 =C2=A0br =C2=A0 =C2=A0 = =C2=A0x17 > > 0000000000000510
: > =C2=A0510: =C2=A0 17fffff8 =C2=A0 =C2=A0 =C2=A0 =C2=A0b =C2=A0 =C2=A0 =C2= =A0 4f0 > > 0000000000000600 : > =C2=A0600: =C2=A0 90000081 =C2=A0 =C2=A0 =C2=A0 =C2=A0adrp =C2=A0 =C2=A0x= 1, 10000 <__FRAME_END__+0xf8f8> > =C2=A0604: =C2=A0 f947e821 =C2=A0 =C2=A0 =C2=A0 =C2=A0ldr =C2=A0 =C2=A0 x= 1, [x1, #4048] > =C2=A0608: =C2=A0 b9400020 =C2=A0 =C2=A0 =C2=A0 =C2=A0ldr =C2=A0 =C2=A0 w= 0, [x1] > =C2=A060c: =C2=A0 11000400 =C2=A0 =C2=A0 =C2=A0 =C2=A0add =C2=A0 =C2=A0 w= 0, w0, #0x1 > =C2=A0610: =C2=A0 b9000020 =C2=A0 =C2=A0 =C2=A0 =C2=A0str =C2=A0 =C2=A0 w= 0, [x1] > =C2=A0614: =C2=A0 d65f03c0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ret Can you link with a version script? { local: *; global: main; }; Exporting symbols inhibits some optimizations even if interposition is assumed not to happen because the behavior of public entry points needs to be preserved. With a version script, the set of entry points can be greatly reduced, enabling further optimizations. Thanks, Florian