From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id AC30F39540A8 for ; Tue, 31 May 2022 02:04:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AC30F39540A8 Received: by mail-pj1-x1035.google.com with SMTP id cx11so4014597pjb.1 for ; Mon, 30 May 2022 19:04:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=28wI2aMUe9k8Zt8rnSX+Ghmn9dtcfQyaTFqFTNMRWZg=; b=R4OFibuq9KlsbFAN/zi0jmSdSOcJ/bHpvhqAkADWMTRgGZ/ucPElKSST1JssNoUsAc I1H17Vu2F0tRi76Va/n1pJbmQ8DihgJrzet8d4Ki61MUtfXMIqwqDFa1sE7cj6Yfkj27 5789Uo4tEheHTkeohlw9IKg91ETTrPx74hhSbwTSP9Xh0hxgrO861002dbycGHbVMItP gZRuIgnRYxJ45XDfbTia8TOi6Oa09YjKaHGi2CrSkYg2xN4L4hzpkroCAaQblKUVPl2q 1F7Di4ycW6IvcxO61qxVq0/Mh/9v20gQLIeoMIzUt9QROHJcPtPk23nYdVg+dDnNERjS DOEg== X-Gm-Message-State: AOAM532qAy38hUkq7h2UsOTM4C2sd6jyjklusuSRFsKBGoRwVs+sEaf6 FxClj4Jwnmo3dLDCjWQhY1UDXT4SNB02j/PYWnI= X-Google-Smtp-Source: ABdhPJw0sxUEyz6UpVOg67CKOLp3AwyPrafXshEBn/VX+iWsxW83ERpbzddbOvtsL9oly0eYdP/T8EqZtoevDM9EY2U= X-Received: by 2002:a17:903:3015:b0:163:c6a5:dcb with SMTP id o21-20020a170903301500b00163c6a50dcbmr11340619pla.38.1653962640734; Mon, 30 May 2022 19:04:00 -0700 (PDT) MIME-Version: 1.0 References: <87mtf5wk0k.fsf@oldenburg.str.redhat.com> <8735gwhz9i.fsf@oldenburg.str.redhat.com> <878rqnf8nd.fsf@oldenburg.str.redhat.com> In-Reply-To: <878rqnf8nd.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Mon, 30 May 2022 19:03:24 -0700 Message-ID: Subject: Re: [PATCH 2/3] Revert "[AArch64][BZ #17711] Fix extern protected data handling" To: Florian Weimer Cc: Wilco Dijkstra , Wilco Dijkstra via Libc-alpha , Szabolcs Nagy Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3019.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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, 31 May 2022 02:04:03 -0000 On Fri, May 27, 2022 at 5:43 AM Florian Weimer wrote: > > * 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 : > > 4f0: b0000090 adrp x16, 11000 <__cxa_finalize@GLIBC_2.17> > > 4f4: f9400611 ldr x17, [x16, #8] > > 4f8: 91002210 add x16, x16, #0x8 > > 4fc: d61f0220 br x17 > > > > 0000000000000510
: > > 510: 17fffff8 b 4f0 > > > > 0000000000000600 : > > 600: 90000081 adrp x1, 10000 <__FRAME_END__+0xf8f8> > > 604: f947e821 ldr x1, [x1, #4048] > > 608: b9400020 ldr w0, [x1] > > 60c: 11000400 add w0, w0, #0x1 > > 610: b9000020 str w0, [x1] > > 614: d65f03c0 ret > > 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 > Should -fno-semantic-interposition imply -fvisibility=protected -mno-direct-extern-access? -- H.J.