From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20078.outbound.protection.outlook.com [40.107.2.78]) by sourceware.org (Postfix) with ESMTPS id 1506C3842766 for ; Thu, 17 Nov 2022 16:42:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1506C3842766 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qf+1CvgIqMEYIhzg6Do8ErVYRubJI0J7O5krLAozUDA=; b=6QLbNbDPFVmvNEUQR30ulnydrWXS4U7hce5bW8a9Xuze097GzjDWgDGNmUAFkgQUJvH7OfdIUN/Tb6oyE+jKmtQAROV2mWr+kjEGvk7HIp2GOEmD4GIFueEBwoqxoj0ZRCyZqVkpska38IkFLwW94Vaz4ZrZID+M9AglPJCaPYc= Received: from FR0P281CA0042.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::9) by VE1PR08MB5598.eurprd08.prod.outlook.com (2603:10a6:800:1a2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.8; Thu, 17 Nov 2022 16:42:12 +0000 Received: from VI1EUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:48:cafe::87) by FR0P281CA0042.outlook.office365.com (2603:10a6:d10:48::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9 via Frontend Transport; Thu, 17 Nov 2022 16:42:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VI1EUR03FT028.mail.protection.outlook.com (100.127.144.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.8 via Frontend Transport; Thu, 17 Nov 2022 16:42:12 +0000 Received: ("Tessian outbound f394866f3f2b:v130"); Thu, 17 Nov 2022 16:42:12 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5fe023a05e7daa0b X-CR-MTA-TID: 64aa7808 Received: from bb9577e07212.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BF9CD01C-BBB1-4171-88AC-DF94F56D219E.1; Thu, 17 Nov 2022 16:42:04 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bb9577e07212.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 17 Nov 2022 16:42:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J2F1+CGjsmL31k6LxaPNaRjhGFL15Ldf+fH2Py+CBHCpMD/BkG1ZXhUWa0q6FyvijKrCKM/tH7zCetoBbJZTvid562pXSjZB+Tc1iWd1IEcJXW9FL8wXCOWFERkLhF5ImLtsxaDAE/xeSjuWO3DugQh7Gdy0+v4FYJgpGWilnhYObVibrnFY1QaFepLHAV+MbQjh3FWKEexYUBAZoGl7ZJd6X+M/sD/nsdwMGXgEqQW1AVWq8woxAs51iz4J/jyZhbEKDI2lalNlhFAke2c4LQQBy41oD6X6B0SZfvn0GI3w1ZcbXQq+PfsxDf3AMRWAXpHW0j9L6I4GiGRjmBhbxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qf+1CvgIqMEYIhzg6Do8ErVYRubJI0J7O5krLAozUDA=; b=IDTcVGFTw+FKwVaxWg2hZrQM82FXyEJMHuxXK4uadeR5JvVhoLrsOwQw219tgHZMffYvdj0kMO0Kom+OVpy8cNPBRa2DVm1AY65DQVdDsvASfI698o/nVGNSs87TEpUrl5aPUoRrLPgJglPu53G1IZND1dljJcP1uGaA2q+f2rVdBjWG0IWGWsAUXeKmJ3oYwaZcXtEeC/rUcR4cQPPO7YesBEsB0mvTPIs3iIJ4TEZpGqytOi0QwN+8NopBbz9laOLUGsbnIyOj1iOHkpK/0b65NGz1tWR89B1xfsKNQZreD1xykp5uffpZPh89vjjw+hXM/2N7DoQZVMvPyCH5GQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qf+1CvgIqMEYIhzg6Do8ErVYRubJI0J7O5krLAozUDA=; b=6QLbNbDPFVmvNEUQR30ulnydrWXS4U7hce5bW8a9Xuze097GzjDWgDGNmUAFkgQUJvH7OfdIUN/Tb6oyE+jKmtQAROV2mWr+kjEGvk7HIp2GOEmD4GIFueEBwoqxoj0ZRCyZqVkpska38IkFLwW94Vaz4ZrZID+M9AglPJCaPYc= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by AM8PR08MB5587.eurprd08.prod.outlook.com (2603:10a6:20b:1dd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.7; Thu, 17 Nov 2022 16:42:01 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::4c73:7d14:fc39:a3cb]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::4c73:7d14:fc39:a3cb%3]) with mapi id 15.20.5834.008; Thu, 17 Nov 2022 16:42:01 +0000 From: Wilco Dijkstra To: Richard Sandiford CC: GCC Patches , Kyrylo Tkachov , "maskray@google.com" Subject: Re: [PATCH] AArch64: Add support for -mdirect-extern-access Thread-Topic: [PATCH] AArch64: Add support for -mdirect-extern-access Thread-Index: AQHY9dtXMtH7hxnFdEmxr5DzGF96Fq5BaA3fgAHR3lM= Date: Thu, 17 Nov 2022 16:42:01 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: PAWPR08MB8982:EE_|AM8PR08MB5587:EE_|VI1EUR03FT028:EE_|VE1PR08MB5598:EE_ X-MS-Office365-Filtering-Correlation-Id: f3e7b38b-92ac-4a72-672c-08dac8baad65 x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GVokL9LGxmnwvhN07/9OwC0lps5NwZ/n+Xn9V/euyuRHlUg6guyoifVDcj6WTNVuz8Hc2nQUmcChe0DY4ao3IcwYy4ilEzj47XT1N+PqoONVXD1Q/2acfRX+uowi+1Yxv7MHfCPdNPx+DF2/TnoOxk+gjU1G22Ydu31v3ZskI7S/ja4cV1zwFkpKp7S5VCCFkpvMT4gKMUYGiDSpckhvWtmT+fF6RDOIO89VBRpPJvJcum+OYPOP9cnihOAnsGOwZzb5jHUW3g6S7emoroRBpb0iJVHN+VdXa2qDkiQ3vEiIV57LS4IBYnEzD0pDi2DAL5TTUu+tgsmMtvakPrPQdX+wob3nlUwlhYHMuaPAe6PxgR6Mwnbl3jpqGLBJeAfmKO+m/0okA+AJtr6dLYA97+NVyMJ2bd7fv7IFKC2hGA1hJUTf4dLi3Kgq+733S2pXQoNi4Lyaa5D7qbgTufW2G88Gigf3KQGJlf/vOFrvEfzJUisK+bX5d9EtD2/UXZd6kHhawkxPjab7msADjJupeZsKPQshfxipaX2IqG/56zoFvHpcYB04hm++IcBnOatHF/eBpk7HBstPNn4Air/C1Hh4wPI2w8eH0QVdk2JSIwal1QNImsKRWa9HsD1cpF5NGCpnhKT1cFmGJ1aqWQvM8p14xKZyMH+d4iTRbH4Erk+L9m0Emy3bRZZIjA4xgp0aDXgKKRb44bGQGmuKWajX3g== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAWPR08MB8982.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(39860400002)(346002)(376002)(136003)(396003)(451199015)(83380400001)(478600001)(5660300002)(71200400001)(186003)(7696005)(9686003)(26005)(6506007)(41300700001)(38070700005)(55016003)(33656002)(86362001)(38100700002)(122000001)(66946007)(6862004)(91956017)(64756008)(66446008)(66476007)(76116006)(4326008)(8676002)(52536014)(66556008)(8936002)(2906002)(316002)(54906003)(6636002);DIR:OUT;SFP:1101; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5587 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 59b4084c-4fb2-4b59-6912-08dac8baa6ec X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mplgzSVhOSwvoiCKekuqsSqh0fheaFAwKUxTGzovF7ROU8N9Ua9MyyczsRsAyNt2ff0A905vZbqB+8KnTSMXM/fKIvkFUBY2VfHTwpnSg7QEecACRlXY7+ImUhlsKp18K9d+QAAsjF9ESYNzK0jJDt4bmp2BDniQ8lvokq6b6c+bqQ0LYV5CuOm8k5gyjqNhKCD0fjkdx1CBW+GjkTgLN0VwO8T5hniYq8RHI3kvr38dSctKF42wai8YzrCFvTPZz6XqaZQ1IaZ+ddkdQhf6gkOf+5eizNvOQpbQdRG/gPR+oxVp1YnWCphOSLaxYTrIpKFDhDpfrvBJf01zwUEY31zF7bqgTwPonAFUiZx+xe6PwmmbVmNXF3UYnrFsgE39uUM/FtkKxTTSkPsnv7vyLKl6dMBuYO1LuhhfjF98/mEGn0A/joFS1DXL0thgPnHA9sx6SSyjT6IoFDRzWO96IBwl3LvvQq2gKnxufphVx8WfBiqD+4zng5sU4KtjA3vhAqb2SqS1qjtdXsHAWQs0nrVFFVic1JPXOXpPusbXIt0v8M3Qciuo21aQYkxHLA/qW9jsC6DI88qMXjX0R4xi/ZElrxHEsRPYsxFDAA9kfYMZGTfD9r1N2AFCcIrnGbfBi67gtSxpaYt7fnWHOQUOg+FsCGXltBLGUL4vNN5ALqRO+w8fvT2cmFgz2if1soN+oe1HcYat56YJnzJAng4S0g== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(136003)(346002)(376002)(396003)(451199015)(40470700004)(46966006)(36840700001)(86362001)(82310400005)(40460700003)(186003)(55016003)(33656002)(41300700001)(4326008)(40480700001)(8676002)(336012)(70586007)(70206006)(8936002)(6862004)(316002)(47076005)(5660300002)(52536014)(478600001)(9686003)(7696005)(6506007)(26005)(54906003)(6636002)(107886003)(82740400003)(356005)(81166007)(36860700001)(83380400001)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2022 16:42:12.3828 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3e7b38b-92ac-4a72-672c-08dac8baad65 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5598 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Richard,=0A= =0A= > Can you go into more detail about:=0A= >=0A= >=A0=A0=A0 Use :option:`-mdirect-extern-access` either in shared libraries = or in=0A= >=A0=A0=A0 executables, but not in both.=A0 Protected symbols used both in = a shared=0A= >=A0=A0=A0 library and executable may cause linker errors or fail to work c= orrectly=0A= >=0A= > If this is LLVM's default for PIC (and by assumption shared libraries),= =0A= > is it then invalid to use -mdirect-extern-access for any PIEs that=0A= > are linked against those shared libraries and use protected symbols=0A= > from those libraries?=A0 How would a user know that one of the shared=0A= > libraries they're linking against was built in this way?=0A= =0A= Yes, the usage model is that you'd either use it for static PIE or only on= =0A= data that is not shared. If you get it wrong them you'll get the copy=0A= relocation error. In the future we need to decide what the ABI is and=0A= ensure GCC and LLVM are compatible. An import feature to mark symbols=0A= that may be overridden by a shared library would be useful too.=0A= =0A= > It looks like the main difference between this implementation and=0A= > the x86 one is that x86 allows direct accesses to common symbols.=0A= > What's the reason for not doing that for AArch64?=A0 Does it not work,=0A= > is it a false optimisation (i.e. pessimisation), or did it not seem=0A= > important now that -fno-common is the default?=0A= =0A= I don't see any difference in the way common symbols are accessed on x86,= =0A= so it's not clear which cases common_local_p param actually affects (eg. wi= th=0A= -fPIC there is always a GOT indirection for common symbols).=0A= =0A= Cheers,=0A= Wilco=