From patchwork Tue May 12 10:14:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38955 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 86C2F3947429; Tue, 12 May 2020 10:15:08 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140051.outbound.protection.outlook.com [40.107.14.51]) by sourceware.org (Postfix) with ESMTPS id 560E0383F846 for ; Tue, 12 May 2020 10:15:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 560E0383F846 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=sWJ5vL2xW0xPYJtIyC0QbZYF+Ts1pzZ8oqZDM9eqNZ8=; b=m1a9126hlv5nk15jjde2eastbw+zW+huYJQ5MhFFiLrtYKl7UsUDRRyDWqreLUXG8/LCN3b7equboztUFaXuOuwOKd29CwZRoyDXx3s5Z91c4VTMNNWjjpw+X2XBRiCWQx1R40V3J+XUXtWV0BIDQTKkHPwYs52nID/He31ViFo= Received: from DB7PR05CA0020.eurprd05.prod.outlook.com (2603:10a6:10:36::33) by DB6PR0801MB1704.eurprd08.prod.outlook.com (2603:10a6:4:38::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 10:15:03 +0000 Received: from DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:36:cafe::a3) by DB7PR05CA0020.outlook.office365.com (2603:10a6:10:36::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.30 via Frontend Transport; Tue, 12 May 2020 10:15:03 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT022.mail.protection.outlook.com (10.152.20.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:03 +0000 Received: ("Tessian outbound 4cdf5642225a:v54"); Tue, 12 May 2020 10:15:03 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: bd11b0834c285d7d X-CR-MTA-TID: 64aa7808 Received: from 1581aa4f4e91.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7DFF871F-7B97-4EDE-B20A-25D5327E9B85.1; Tue, 12 May 2020 10:14:57 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1581aa4f4e91.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:14:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lonmn9Do76QMUYTc7pwPOeP37EZRBrKnqMaXmFCCgKXhCdcY2pogUuAjXCla7tDQarpvNyCw5d+u8QUMFX9OP8LiIOat45vsPsfC8Q7oDX5dZnhRuebM0w80onqkqr1RsYza4XBfb9Mxl7xx9v/acE6HToTU1sB5RFAvFot2t2ZTwpsL+JM+dHJjs2G0S815ziibfWetRSxvAmELXH/MFIe/ivGABYp+55z+/e7jBKhqJrkD3mmUADuFrOX1mAGzhPOjhNkea0mwKN45/46+s2sh//hpf8miIOsikRQ46aIuEJXFA20kpOpP61+0W93d5zUQFam3/woxcXwIaXtxiA== 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-SenderADCheck; bh=sWJ5vL2xW0xPYJtIyC0QbZYF+Ts1pzZ8oqZDM9eqNZ8=; b=Rl7egv6xUxU0unMIZt6fPSTgs5yfqOdXN2BYNDX6DqFa8fm38LwdzSI3Nps2fFNZqcBP7REJrtDvf118jySlWqlngPkmF9ONdlxxTiFZ6BFjtjXi/6HzT06ZTkZqkl69kyblQ4Pybj+in74PuaE5JeCXLiZyA2/6lOFvQ7ihkhn0ARM/NLC6Hk584xA3FwFEn5sUrO2UbnZZqGXpk+oLKSic4P9akxY6DSJyr9GfuQjFv158aEZiH0HwpD/q2bTaeyaUsVNN4yr6oBKOcqrCgfKjxHlsihBTsfm7LznTS6n1DqjEpGACWa68R4rxN7RaJejA+ATEFHhcg2h0efanzA== 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=sWJ5vL2xW0xPYJtIyC0QbZYF+Ts1pzZ8oqZDM9eqNZ8=; b=m1a9126hlv5nk15jjde2eastbw+zW+huYJQ5MhFFiLrtYKl7UsUDRRyDWqreLUXG8/LCN3b7equboztUFaXuOuwOKd29CwZRoyDXx3s5Z91c4VTMNNWjjpw+X2XBRiCWQx1R40V3J+XUXtWV0BIDQTKkHPwYs52nID/He31ViFo= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2949.eurprd08.prod.outlook.com (2603:10a6:209:4d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27; Tue, 12 May 2020 10:14:56 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:14:56 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 01/13] elf.h: Add PT_GNU_PROPERTY Date: Tue, 12 May 2020 11:14:37 +0100 Message-Id: <50ceded3276bdd151755f52a7d0e9da26e736d8d.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:14:56 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5f7398c8-0ad6-4d9f-74d4-08d7f65d565a X-MS-TrafficTypeDiagnostic: AM6PR08MB2949:|DB6PR0801MB1704: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1388;OLM:1388; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: /UqG7GcvNVUIwPDOysw9pbEkTSDf4jSUOyv8GJY+ztLW3lvXBmP4DXy5c0pHeQgmlZXYovq1wDyIkQm2HydC1SYt3aQ2OPdw8g6Mb0xxjHSLyhL1gwfYC2cXDDU7Z3VGa3piqWDoVZLYp/ACJQFl6wsGLWfSuntgEnUvjKolZvsKFqtM2JAqOF6S1xJ0YfNIJvm8tfK7CXaMOcrnN/mPLyGGlTJnwSlyXVBv5w87SHEIUYVhdWFN59yLHgyL4awFl3yvnINo3ScX1jcdZMOJece9n8X8z1ENnbgbFawPfnNtX54NmyIHkpIaVWTMD0G1C87n/dQ4Cs/tbpsmo0V8KcrTidqLcTxxvx2gEgS0XSk1rvvw1UeLPUmOz+xuxhpBkoe+F9meNV1hd2LL+/zGVxi1qoQTxs6vH1vVxwvbzN0IxqWyAFUWRDGs4+5ndBgh/Uu8ypMRSxAcsDHnad3KszjwJ6gCJOPcsWqZkN5hXPVrETwnmkl6uw/M3+cFD1PJ2LX66yupluKH2b4XaVRCjaO8lFamgjC5/sb0m7ZoAg5UBvSu2lBB5iQEKNRRmdQzAbmKLn5WWFQ9wAsWFXw73IkENDzi74a5O1O+96sTMv0= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(366004)(396003)(39860400002)(136003)(376002)(33430700001)(5660300002)(66946007)(956004)(66476007)(52116002)(44832011)(33440700001)(36756003)(66556008)(4744005)(6486002)(478600001)(2616005)(26005)(6506007)(6512007)(2906002)(6916009)(8676002)(186003)(8936002)(16526019)(6666004)(316002)(69590400007)(86362001)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ua1qrUBfSUVZA1gk1xVNsx0OFcheeV6QULCv0aMujpY/uL3gOouqj3Y2f+sTTz5rz3wOzPuXRdvNbAae8VSjf5x4EK825ZEUr8p1yR30VIh7+E2wZOAM4poBh3NpM0D7mKYXy7IHxuGkToNqu/sytBHanQ4F1rWA6FP+S3asbZLM4+HxopNcjEW2wrkL698WaDD5EOirZBzfVdzBG365arAIP8E369COdS1R7oQlH4HmFQB70qx5YQpT1OoFI3w+USTi+qUBiyq9aGeTNCok9MAQo5GbB3AG2IFA1SJ0QSUEwKjydSPvX68URHHFyQl3EbyrB7I0MaO6IZILI11kMaguplHGW3OHuoMwIMMEqK6RYtRWgZ+wbJC7H6eknknQUCx+lyWwaUpZGRFAmB9JGmOYykNjc9qJ2Zs2iwWK5U+hIgcyaifa6N0FTY/1KY9njBEFvdvMT+2Vgo5bU6bkmAQJoPrSFbyj6Rj9zp4EGrHvbRWOjkCWVVV0JJg306wd X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2949 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(376002)(346002)(39860400002)(396003)(136003)(46966005)(33430700001)(186003)(316002)(6512007)(6486002)(2906002)(478600001)(33440700001)(70206006)(356005)(86362001)(82310400002)(82740400003)(81166007)(16526019)(8676002)(6506007)(5660300002)(8936002)(6666004)(26005)(6916009)(36756003)(70586007)(956004)(44832011)(47076004)(69590400007)(2616005)(336012)(4744005)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 7beef968-44f7-463b-913b-08d7f65d51ca X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3Bh3Og+UwTBPVvjWTd86J18w2x/D9jI4FKbyDi45Wt7bny8kRgsWVLHGaGFgYYfvZUXFkZtUMSdWT6r6DuRrga3GrqEg1yQudkQoZFeouPXdbHQy7iVlGkjfkcZXSi995wlj3Md0tPKJNVr0HsbS5J8FWBOzUvuAmVgz+mpCWJeHOUPJHHfnvLVEvHLl7pdVdOkrEGgTBbuKD7zn5XsVOyrhBiVJwofz3NUCYZrW9bj2NNnqqXf3AExTpw652m6hiM59J100Whbqu7qYx7FWWvyIXe/4rxoCV/xnH7QAg2tjaGr7o6DfN6qA4JaTA0LwieMq9skS41Lxy7uS4G2KLYqZoP1Q0C1c6Vj86KXvqyFaHkW9SPf6QIb21aOjpgnewjLZKpYKEHuO7a7nSycIOK4crzczN7092NsCIlWrHuQbMHl59EJGehoI3qiyTkZbbld+f2dC+x6dxinJbj0BfGmbXgpvYklX5Lf6YL8quuqT7/yeL84upY78RQwLxRgncDnoy5Ub/8bkfFj1ySS/5JMJE5hHIEfHZ174fAZsjgtQjjO5eESqTiK0XJBjy4tMQFIpgMyitkl+II8fCJ3bz99os24qaGDxW2je4BzhTGomvTEelC6eEt48OmkBbz9GCHhtjPVZ0klanx9x8PjKgA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:03.7304 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f7398c8-0ad6-4d9f-74d4-08d7f65d565a 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1704 X-Spam-Status: No, score=-20.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This program header type is already used in binaries on x86 and aarch64 targets. Reviewed-by: Adhemerval Zanella --- elf/elf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/elf/elf.h b/elf/elf.h index 51e9968405..5b5ce37d9e 100644 --- a/elf/elf.h +++ b/elf/elf.h @@ -721,6 +721,7 @@ typedef struct #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ #define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ +#define PT_GNU_PROPERTY 0x6474e553 /* GNU property */ #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ From patchwork Tue May 12 10:14:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38957 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A0A7394B01E; Tue, 12 May 2020 10:15:10 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70083.outbound.protection.outlook.com [40.107.7.83]) by sourceware.org (Postfix) with ESMTPS id 4907B393C88D for ; Tue, 12 May 2020 10:15:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4907B393C88D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=0iMYtXA25Ruk30C3cThZitJJerGPScZhj5soCKPRcwM=; b=J6ExO9tOlT1gjJszXFToeBCXQYrNrlq81BDcabWUF1lkwnvSME4wkvXS7SxC8cxd7xe+iqrA47L3/k7yULQHhwPTnMjuVqm1wlPWCREuydNqaPtar8MLe2cd2nVjkuGd4ITp2ecl4K2oYgi148RKDuym7QUiHnV8BdEU41ot6po= Received: from AM5PR0201CA0010.eurprd02.prod.outlook.com (2603:10a6:203:3d::20) by VI1PR08MB2941.eurprd08.prod.outlook.com (2603:10a6:802:1d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 10:15:04 +0000 Received: from AM5EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:3d:cafe::49) by AM5PR0201CA0010.outlook.office365.com (2603:10a6:203:3d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:04 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT021.mail.protection.outlook.com (10.152.16.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:04 +0000 Received: ("Tessian outbound e88319d7ccd0:v54"); Tue, 12 May 2020 10:15:03 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: aeedeec9472ba74e X-CR-MTA-TID: 64aa7808 Received: from 9f99ebe2ecb9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 35C7515A-7D3B-4DA0-82AC-5B4D77DA4210.1; Tue, 12 May 2020 10:14:58 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9f99ebe2ecb9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:14:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UlgFO9YY+Dt/flPsj+9r1f5LMRr+njFWPXoe6UWUOdCPTOcTBCjxkze7Z2m3g/Am5rFcN+/u82v8eSqZpQHEDkuG3BRuIZlCJkzEfEMkGIqxIFtn9wceucDZsaIkEVemT26ILXNMfywGbBRU0llRNw3araN/lHPMuorMcyvYkHwvpj7CUQjXuvoXFdceDJoNc02dSU6xCazFz8rvU7SZWi4pSsNcTPOryFbJ6jwPQvf4QQUKix3KmxOowrZlV5jg9S8AxMzCadfjJP6fB3Clz9sUTf670+A0/yXrIdpzv7klW5FVcVm7WuzbO/G4cHF1uDdko5RgO0JSNx8BxEtRHQ== 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-SenderADCheck; bh=0iMYtXA25Ruk30C3cThZitJJerGPScZhj5soCKPRcwM=; b=bCjEn1vokRbbpgxi9uxwYZUG3nwePyja+Pg3AVhVTiVRLgkFj6LiHtt3ZKSeTPCwryo/rvhZWhm4S6bw3e0RidAcD1Sp6RsKTEQLsE75OsuaH3qflIgmb3LTURI+q9Q2mAE6HulEyBmAiv98QPLHuVpUGfKuJtL4HNhlKBF3+AuY4Ui9kWTCCca23f2ymyVfOfXVEfOHIy/FGxLY0PCu792iW3nrkEflP7DYOyOtE67nyYbksF55JBWFqBwyhtd9KralJkDWel8gxpbILtJJ+fMQY0nVpe1y7ndqIh2Mhay+HHWokxX2pCp31UropRl6/u8KmX5N4iKvUl5xp+vNFw== 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=0iMYtXA25Ruk30C3cThZitJJerGPScZhj5soCKPRcwM=; b=J6ExO9tOlT1gjJszXFToeBCXQYrNrlq81BDcabWUF1lkwnvSME4wkvXS7SxC8cxd7xe+iqrA47L3/k7yULQHhwPTnMjuVqm1wlPWCREuydNqaPtar8MLe2cd2nVjkuGd4ITp2ecl4K2oYgi148RKDuym7QUiHnV8BdEU41ot6po= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:14:57 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:14:56 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 02/13] elf.h: add aarch64 property definitions Date: Tue, 12 May 2020 11:14:38 +0100 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:14:56 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 01a08df5-2759-4d1e-317c-08d7f65d5692 X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|VI1PR08MB2941: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:5797;OLM:5797; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: D1TMZNa9esjqLxiVcv4TpKV4z6Pi+iKuzAcPeCzFxrB871L5eqkTSXpAKR46Vo8NoGGDsNuXlLtr8pG3yO4s9FAbq/4V9WyBPj3AQqTNBV/LhAbeq+TlxWusVKYlkVg8dwgZcZYIYw+xJL2D/OH+vXfRimQgpGU8W44S4J3YXcqwgUXwUFLHbadW0ezqh7MNYRZGp1k+LIvMgdWIgqfNzc+SHDSuyDrURYllmrnUuUs573SVIZj6v4NMMd/hJu3oUcl6bGUm3y7c7VHPfeBECxJznV4ZdbggGwu84b/17Pgh2X+ioHViVd8y41Tz6bngXcW1CETiDdHOKrFqXtgk6tKflYsdvoLMOjnbmPDg2JDQ6jgZLDn+dnuU7Tma2mJVyyXIWa1g2hj7XffnPHBrP2sLadAgGFE7h8QCxwLtWAexmDfXUW0k+oHf1EAq4eDeGo1vX+yG7pPAfMTqKugyleo3LJ5NN6tJYdDiVBO1++W+gZ/sPPMfxHyHiJyIE8mpZc0MxGa0WfFbHVQBHlLt1mpreFxRn26NRxIYHsKUZboZdqQZA7KFUAXiMiK3COwPX8aY2OpjZzFzZNuasqNhwpJzQ3qNYWMcOiIpIAakqp8= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(36756003)(4744005)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(33440700001)(6666004)(478600001)(6506007)(6512007)(8936002)(26005)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: esWSbdaZPDCbzXjbuWSkUIOn9A0mf/NahKfl4JthSOACE4GpGkpb2eIf9rKpC1QKpndxxuIlcif2NJga5HZIfA2f7KXJg8mTXuMEUfXSQJFlobG4QV2EIAOn7nmBWJ41fvHpOfPtSLHzAvhxs1COgvVQvPivLBPmiMVUGzTb3IbhwMqARv1ilPHmyKW9GUSEE/i/cbjg8BS3kWnMonEYEnif0QkRctDT2euuhaAUoHtcE5Wf0aePeg94zE/3cn5YB0AoBU+QgCWW8gN1+GEbYLhit3Ginv5WyagCnqzfvieUv8MApp+7oNWjJawXcbIEOihMBXlUUKdBH5seIhoxIyLiT56nGSIS0+sdKcTKXEgNnSCCdC44nJ1Nw9OcZsIYL2azrrXUWxrZwOBRuL5nEYrY+MaMc/22CrGzuSYKGIg+JS37XCocv4y2ylxbM+gWtOh1ZEGfUcjL08RGwc+SjD2eBnTWxjPxqHYFY/ga2Lzi5/frm/cuudhSx/3we1As X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT021.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(346002)(376002)(396003)(136003)(39860400002)(46966005)(33430700001)(6506007)(5660300002)(6916009)(82740400003)(316002)(36756003)(36906005)(70206006)(478600001)(70586007)(81166007)(47076004)(33440700001)(69590400007)(82310400002)(356005)(186003)(956004)(336012)(4744005)(86362001)(44832011)(2616005)(8936002)(26005)(2906002)(6486002)(16526019)(6512007)(8676002)(6666004)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: f6e3b723-d4c1-4d66-5caa-08d7f65d520d X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E7OESGNJmeBNE3AO/4dWuDmyogk8qdu6tSEFo67tXIJOyEkbpSGLcJ0aV4HZh5fqBcGHAQkHzM8AMEBaYFd3jZPwCWNwuGTj4TC+FsrRn3/p6rcOYokLxiw3N4w785XOvthKEtDsX9l9BJfhah0kMaLfaLvc9asaAUxePsT3871SJfn1zjtyAu6R91LDrIPLRjKq0Ssd2R5ACvogQa7IE9E/miFIUYmzXnrGFX3GABWuIog1Da7S8yomqeoQd2UifoNaSgWzT7Cz81x1UlIQjDwO9quXtT6KwSDi3Whb8qgt71g6w3vSZM7wViUcUzhpg5N5prqwsKWHTOjH7pkHb38MC0KEkLKoZOyAnCIP/t7sM7865uvS+PeBaKeWfGUQh0JOhQlAtumaPMrLwFbIyEiEYtdoET5+pSJa1R83y8WWGr5Xao5AfNClnSoqgTDdM1IhQm5FJyivBxCK8EozF1M4tkpGmreHjhAuaR8C4LWtiobsK6kIm0yzj2Tz8/i7y4z1wmDPOXPiuF0stvy43qpRzcFKOf073Vo0i2/owHLCvZ0O2iHH7XMH+jyX5jeDIsBJ3tTznDbp6WVUhDQ01mZuUoj6QT74v+J4NnZIiUD+BSR+kp63bsQv4YZ9b7vDVag4BcL7xLgkh9iJcKdULQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:04.0397 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 01a08df5-2759-4d1e-317c-08d7f65d5692 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2941 X-Spam-Status: No, score=-20.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" These property values are specified by the AArch64 ELF ABI and binutils can create binaries marked with them. Reviewed-by: Adhemerval Zanella --- elf/elf.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/elf/elf.h b/elf/elf.h index 5b5ce37d9e..197b557d15 100644 --- a/elf/elf.h +++ b/elf/elf.h @@ -1319,6 +1319,12 @@ typedef struct /* Application-specific semantics, hi */ #define GNU_PROPERTY_HIUSER 0xffffffff +/* AArch64 specific GNU properties. */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000 + +#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0) +#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1) + /* The x86 instruction sets indicated by the corresponding bits are used in program. Their support in the hardware is optional. */ #define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 From patchwork Tue May 12 10:14:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38956 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EF8A43948817; Tue, 12 May 2020 10:15:09 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120041.outbound.protection.outlook.com [40.107.12.41]) by sourceware.org (Postfix) with ESMTPS id C7722393C887 for ; Tue, 12 May 2020 10:15:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C7722393C887 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=CG53rVHwL+ctx7M8HbkgG4gtY2fbxU7d7vLu1lWvgEY=; b=GJc01Imd4rfHE5okSl2PpMUX/Rz+OAF4HKqiwiP8i1pQ4dY3K11xtBDxmyw6H0LiDLIxmkNjsThIXC0yYlcW/vQxiAZAqvMrTlbOHr+pgpM7eak5ZE+QOJRKm3riXxilajpDj/HMFb5Qpu4/2+Er4mz/SZNq3JE4tFuQDxnuezk= Received: from AM6PR10CA0009.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::22) by PR2PR08MB5228.eurprd08.prod.outlook.com (2603:10a6:101:21::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.33; Tue, 12 May 2020 10:15:04 +0000 Received: from AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:89:cafe::53) by AM6PR10CA0009.outlook.office365.com (2603:10a6:209:89::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:04 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT054.mail.protection.outlook.com (10.152.16.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:04 +0000 Received: ("Tessian outbound 11763d234d54:v54"); Tue, 12 May 2020 10:15:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 092b6d57b1a433d5 X-CR-MTA-TID: 64aa7808 Received: from 0256e95b6480.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 36F9C499-DCE8-49F1-AFA3-F7A7F7CA3A73.1; Tue, 12 May 2020 10:14:58 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0256e95b6480.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:14:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ne//nhtp7An63UyP8jqNq+J4yda5lL9IMYc4LV9AlefK7TWp7vuwp1+Eyc3yhTsmdDqmH4jK+IaLE7mQ07F9fxvHwuZ1X1V/4EUhSjY/WiOF+w/DBe3g06RCAJX3J4dwsmUQARy78LR0g1BMMFxabiMBZBBrmlHPILVyoWYx73Mwj6RH1a2q2L9nc29Jvt1VlET00dOLCSLtMrISZdgJ5skYmz0q3yvxids+A0BpC8AYSEJAl8MbTk0yKhE+jbZUrtSqNBXjI0aQr4rGg+0z57WngbosiKkOixZtw+3hGpREQyjrHiRaiSYQ4mKcHA/fkGfOx2EOSCVXM6e/Qzr26A== 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-SenderADCheck; bh=CG53rVHwL+ctx7M8HbkgG4gtY2fbxU7d7vLu1lWvgEY=; b=aqn+CF0fKmq2OnVeIp8rpirx3r3ZsntjAEsG33q8nDfwqid/IfDUaqXWFmh6BivD7uco3u8CMoBKoDyr+d7xT35jkDXkqtQXeR2fHqN9wyNOgYisuuRYadxRhQiBeJsxgIwiZ6/nI3HKONJbKPeyRZU9l4+4i/dcRSJ8uxGimpdE57d2hQdqpyh0ttabGXlE/xqLTgt9c3QkXXtUB/HnNDPuO1r1DftD8BE4FkMak7kjfrnSc/fejQ0C4jhWyzFNT54Bo2pzF1OWx8k9R02K23MuOt8IWcfZZeSeZhZX4lkAoa7yUtTGhFhva/RJwuOr7LXIAeqswsKo7CVW/kEwTw== 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=CG53rVHwL+ctx7M8HbkgG4gtY2fbxU7d7vLu1lWvgEY=; b=GJc01Imd4rfHE5okSl2PpMUX/Rz+OAF4HKqiwiP8i1pQ4dY3K11xtBDxmyw6H0LiDLIxmkNjsThIXC0yYlcW/vQxiAZAqvMrTlbOHr+pgpM7eak5ZE+QOJRKm3riXxilajpDj/HMFb5Qpu4/2+Er4mz/SZNq3JE4tFuQDxnuezk= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:14:57 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:14:57 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 03/13] Rewrite abi-note.S in C. Date: Tue, 12 May 2020 11:14:39 +0100 Message-Id: <91817a2bc76bf8315125322ee866f99b256fe867.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:14:56 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: bdfbf287-f15f-4833-2ddb-08d7f65d56c7 X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|PR2PR08MB5228: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 0+U/7y/u22UaSzpUCD8bXtk0ijFN8HiSCMrgUx+AYAa2dQXJ82NkSy0UqoHKO+omtiwweTrCxLYqNaXOG85heQXPtCFyMmwr17uAcysgd/XGufi/beIHeoN9beZPDyO/nDZnbgLGbADTuhBaobbShXWmHqyg13IcAn4aWc7NbvINlTiOfjh4HHgPdBv5ftXwCXqwp7AOWlRVDaksiCJJAOg5ixAZfJ9bpo5Yb1K3BdNAUfqcZviFBuVjPS1u6T/hzd+qyVU8ibMC9+uHFClaIlaMmGNc21wODwLEthEI/FVoGpkq6nbIvGxv7ZTCEZ/5jjj1axvm65tkAVcw4kyPVNT+x2o/5SCVYaSWJPXao2fgVG1ayhEEeCt2ILbP2hLV/bw5xeG5ZRGqJlyhFKPuApVqG3QjRQO3+ffs09SbFMKOaBmoGXTFPFY/u4Kf+1twgmiSOZ4RwRSQExU2OcEluzodptzO3f8G1jB1h9ysaOiF6X7xFwQE/sVXItlqC2L3Ux8oj3gWestpmn46CY8KA2C0sAsaDJDdtDe/TXskxQzsG6JPDXkmyEzcaUMUim8Ht1j1fyLsk0FufMti11/PQmCqW+nYM715F2S1MkhnIC4= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(36756003)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(33440700001)(6666004)(478600001)(6506007)(6512007)(8936002)(26005)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6cSq+1AxsCt++m0eJI4bfY+y3o6FlxNYJMYT2Kfn2EbrcFxJlEMbWuUup2BjVOTfCBAcyM3N5gRXygdvqYyCixwHS+NCNMQ+O6d/nsolBhrZctyGX7avwkm5ltUSInShdAgbunHPRpQ8vkcWcZEyUGO/9c5kN+lgA0BEa+XT081wVtP/GLFnodYZfYzh+NcdiLFTXlf1Fuva9zW9cl21LSf1mxJgHaeo4B9JG2jz8J3+2hG1fQZgECCumq9aEN8OxrrfrccQfh0v1HcEkIXdlkLp7MOoxHisTFa5J2Ea/Fn6rPTeAva22/ZH/bnXC7Mbn4eQhZaDklwx5FTgqwO4K34Yq8OsFGr0HrDdNR83d1xsxDDHZ1unq1Gr2l8KqPZJxn6LyHLG1Pyf9q3K8bUaimdtuIi37mrFNnHgwRBNKY3RgHTDmG4wxU9ju9Z6fEnB1BWgjHxDTGvoTSGKfO9IMFGFw0c4WuTlXwuJXMnLCKD4xqumJ1laZyeyoX8DZ9T8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(46966005)(33430700001)(69590400007)(82310400002)(6512007)(33440700001)(86362001)(478600001)(6666004)(5660300002)(6486002)(6916009)(8676002)(336012)(956004)(81166007)(356005)(82740400003)(36906005)(36756003)(2906002)(2616005)(6506007)(316002)(186003)(16526019)(26005)(44832011)(70206006)(8936002)(47076004)(70586007)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 6b2594a2-32a8-43cf-0112-08d7f65d5250 X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mSanrB4I90k0X0E2E/h/+UMvUeQstb+ptMgUdgzA+5oR1eH0nTse3oFXTwBEinGf0/IrnZckF6205G6LVhANU6nTMW6eud7gqGfD6CWpqIu/jyQizApB1YEDXnmKKtcHJDwBlMzsQyAgiE2YoXZkU94CAwOvoNJmja1ek8J7w75Ee1axmni3q5+kY7VWN7c+9cBBkjL7lji/DCD1CG2p7dXnNxmFSdpd+m3msELmEJm2x57RPnMgMDQ8/uvfdC6bFq5R9PszA3C6Q/lxj5BopGJ9o6Hv52Xe1rQdMD3REYXSofbCDtmUYynxb3bMnv8cBHG6Y/bR0GgwUvvMQK0qQ0nzyik0Dtj6+2sdcOnVG8sKbIGO1ldMgufHkkI8WV3fH2s2QPVd+i//sVj6UR8RJhMvt07G/ON0kJny1x+XiwUksb9x10q1+fjrrn9GW2rYdXnfLjISUUGWIn0NmojMgd7qJdBuWveDsmd6FBStfTuzkqN9mT4W8TXPgoz1Sf3fx7iThSfpCHk8kPa8i4Ydv8LYsmzAFA6HeYnm+N2eg36m2REfbMCue/xxENxaoOY9L8Cd392B04nx/XdQuHk/9pDvCHaByQehq4GoNjPos9jW//+0cnB6dE+TY6AGcrE8SIg/AQpQGf9ykbFaGbgCig== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:04.3960 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bdfbf287-f15f-4833-2ddb-08d7f65d56c7 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB5228 X-Spam-Status: No, score=-20.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Using C code allows the compiler to add target specific object file markings based on CFLAGS. The arm specific abi-note.S is removed and similar object file fix up will be avoided on AArch64 with standard branch-prtection. --- csu/{abi-note.S => abi-note.c} | 28 ++++++++++++++++++---------- sysdeps/arm/abi-note.S | 8 -------- 2 files changed, 18 insertions(+), 18 deletions(-) rename csu/{abi-note.S => abi-note.c} (88%) delete mode 100644 sysdeps/arm/abi-note.S diff --git a/csu/abi-note.S b/csu/abi-note.c similarity index 88% rename from csu/abi-note.S rename to csu/abi-note.c index 2b4b5f8824..cd45f17345 100644 --- a/csu/abi-note.S +++ b/csu/abi-note.c @@ -53,6 +53,7 @@ offset length contents identify the earliest release of that OS that supports this ABI. See abi-tags (top level) for details. */ +#include #include #include /* OS-specific ABI tag value */ @@ -60,13 +61,20 @@ offset length contents name begins with `.note' and creates a PT_NOTE program header entry pointing at it. */ - .section ".note.ABI-tag", "a" - .p2align 2 - .long 1f - 0f /* name length */ - .long 3f - 2f /* data length */ - .long 1 /* note type */ -0: .asciz "GNU" /* vendor name */ -1: .p2align 2 -2: .long __ABI_TAG_OS /* note data: the ABI tag */ - .long __ABI_TAG_VERSION -3: .p2align 2 /* pad out section */ +/* Note: Custom type is used as ElfW(Nhdr) is wrong on 64 bit targets. */ + +__attribute__ ((used, aligned (4), section (".note.ABI-tag"))) +static const struct +{ + int32_t namesz; + int32_t descsz; + int32_t type; + char name[4]; + int32_t desc[4]; +} __abi_tag = { + 4, + 16, + 1, + "GNU", + { __ABI_TAG_OS, __ABI_TAG_VERSION } +}; diff --git a/sysdeps/arm/abi-note.S b/sysdeps/arm/abi-note.S deleted file mode 100644 index 07bd4c4619..0000000000 --- a/sysdeps/arm/abi-note.S +++ /dev/null @@ -1,8 +0,0 @@ -/* Tag_ABI_align8_preserved: This code preserves 8-byte - alignment in any callee. */ - .eabi_attribute 25, 1 -/* Tag_ABI_align8_needed: This code may require 8-byte alignment from - the caller. */ - .eabi_attribute 24, 1 - -#include From patchwork Tue May 12 10:14:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38963 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7C9633954C76; Tue, 12 May 2020 10:15:14 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80075.outbound.protection.outlook.com [40.107.8.75]) by sourceware.org (Postfix) with ESMTPS id 72DEE389780F for ; Tue, 12 May 2020 10:15:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 72DEE389780F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=iZh5KL8Go1oj+k9t8KzDO6b+0S5YUJTizL+ZLniEr7k=; b=HAMD2B0Jc9yTKZcDcuG0pS2EGIxccnNgwy8QAkV0JwhcPVhIeKOSXnEWIT2Cp4chmFGK0D53DwmeDIJTiu8Tv/mWOm2YOq6wvz9LsgItLelpzDB9gW2i05zQ83OQbuJbu2vXmcTJbFvBm17ilkNBAKsGBorviDul5o4SdEHCZRE= Received: from DB6PR1001CA0024.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:b7::34) by AM5PR0802MB2435.eurprd08.prod.outlook.com (2603:10a6:203:9e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27; Tue, 12 May 2020 10:15:04 +0000 Received: from DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:b7:cafe::46) by DB6PR1001CA0024.outlook.office365.com (2603:10a6:4:b7::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:04 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT003.mail.protection.outlook.com (10.152.20.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:04 +0000 Received: ("Tessian outbound fb9de21a7e90:v54"); Tue, 12 May 2020 10:15:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8ae9410a25c3b333 X-CR-MTA-TID: 64aa7808 Received: from 568c2952da1c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1C552128-0C31-408A-B814-01E2870D9A8B.1; Tue, 12 May 2020 10:14:58 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 568c2952da1c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:14:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dh6ZCzYeSkMZFjOZHvd/byvUkJhsLfaTFN3Ko+ABIt8OA5mxD0pkeV1DbjL23TGX64xclek1y4S5V3d7Rmz479s+aQqGu5LR9JfVlwJKQ5G/66Tm2vrKV2H3zt9agAazyavuSqaJatH1Ocym8NGnqrxTlSElclxMvGaWbyrvHMHBP7R/KceBtLDWIaJNvY/QSle+mUO1UUW4FN1Ask+qHPtCP1piB8relCVrdgGHcToK2anN8mNoRxB0r9hcy3ur8Wxe7WYvhF2CqaJGPbCf8YpHcSGniwYOWk1vAVuIK/Y0IOmRAlA9RxMMuH0jGspTc3w92QUJmyJxBM7tL3qbqg== 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-SenderADCheck; bh=iZh5KL8Go1oj+k9t8KzDO6b+0S5YUJTizL+ZLniEr7k=; b=FOm9BeVSi3QcostbobjvXvQwR6GzPBFzZdRAQcpTAyxpHTRf/6k2bu5irPoX/O/7wGyHYhiQs6o9w7dH9s/9l/2rAhZPnBqmIr2AmTyEuhXnVRPumpWnW1mM2MN1rq/TsqsOhlOyPTfuN/iRK56chvyvxVR7Dz4XtTh/lVF7sWNiIYESpB4GAIBNUUzY6qTUxOupuACGGZVhEA5Bx+hjppH8uYJIB6N7KFMQEReIH74t8rf2yIRmlGnygF3jDZmzaizJA5O9Gsbpax73djZUupDtlH+cyvt6p10zC8civUpUDXVgKoHYOlahopxjHTSpJVLSdw4eh88RpekW5VHqiw== 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=iZh5KL8Go1oj+k9t8KzDO6b+0S5YUJTizL+ZLniEr7k=; b=HAMD2B0Jc9yTKZcDcuG0pS2EGIxccnNgwy8QAkV0JwhcPVhIeKOSXnEWIT2Cp4chmFGK0D53DwmeDIJTiu8Tv/mWOm2YOq6wvz9LsgItLelpzDB9gW2i05zQ83OQbuJbu2vXmcTJbFvBm17ilkNBAKsGBorviDul5o4SdEHCZRE= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:14:58 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:14:58 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 04/13] aarch64: configure test for BTI support Date: Tue, 12 May 2020 11:14:40 +0100 Message-Id: <0b0dcdd2731b75a82ed9802a9f52be72babd32ac.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:14:57 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3451d0d6-2c86-4c99-b314-08d7f65d56a0 X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|AM5PR0802MB2435: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: G5I0zbtiVyWHD6Q/93h7Mg3Ouo84NbhcwIH2mQk/viXXUyqJUolzAGEgklm25Q0okq6K40MMmkrpgHYP/ezBcs1P0FhdtQxNqNyriOSg3fKUazl2bKFZB/BpyCEEE728HHEFmvFf4AFjixFl5BEC4Z3cjQpUo3XwQxG9/lbZD4uYm5MMWQiV+L/QzPnPtVvDOWblXqCs8PF18L6Psi3D6pIz7pSCDNP4iw5EVCgI6WgoSGs6A4flXsF9WtQ+t+MbMFuEWtvyvq3zqTNoijjBSzJoBC+DgVw2qD9aIQDAIRIeuAvdTBYAfnflWwAc73yRqKWWHvsqn7l0HnjTSko1/9/rbrI0HMAmSLda5J+qJYcdBOIf0Ue6Og2SEuNNsqwQkD8kjWZymvhCJQZaQivSGl7sO5Z1Yb3qWaP4EXTAZ0kOihwl7oHorhDJ8Z+O4ya6Ub6MTuv//LeP5ZcPOe5ftVpTMo1GRAv5xQRoMuPlwVUrxDynCB7QZHV9aWovFzhcFap4I+zGHgdIWaWUrw7io50koQR+XU2WDjGuxcb3xJZqZPS/Qh0TnSLYYiOBxfmkcMSjF/GxWPeNRnW7gO8itNkfngRXN2tBiYbK9BsG40M= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(36756003)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(33440700001)(6666004)(478600001)(6506007)(6512007)(8936002)(26005)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Zw/7GEu032nCKqbzM9Z9Iipsoqfffq5pTv8DUQzMLiKQ18xtvMftdkOt7iXQQXIS4JfjbCRxxwuWEuJNS/3IvKM8lBg75sDtP8HUNLIc9u5vGrVqbEUKh+GBXDD0bd16nJajgJEdheJfutJ6SduHDy5bQ7LS4Q0XhXZ/LkitjlHOwNEokJXorxxobSbjCptzWxr9ISna6k80xQOPFaDjRitKygjMDqVXIUm7Smq3TvHWRmLHc91CDE+hk9ee212/vG+t8oeId1FDqgMH4lI5pDHEc7S2+MLAAw8BcIAY6T9+IRnMPAj22n3V2BGW35bzcMfynM7pDUml5UXAjdDebBf6ElyGRSG94UufgbWzaF/3IuQ4KJPpe8nW2+axaIwvR0fzBZoenhYvcX+9Kcwsb5ob96EFUg+7C64eA3rYYsg7tWLBm99ffBz00f0haiZYjaclFrYxkcoa0gDGwLAtReg3ZooBaeXIg1YBECOkZgk0YMFWGZDm9HYVG5Z5PnGd X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(396003)(346002)(136003)(39860400002)(376002)(46966005)(33430700001)(82310400002)(6666004)(6512007)(16526019)(336012)(356005)(956004)(44832011)(33440700001)(478600001)(70206006)(26005)(70586007)(6486002)(2616005)(36756003)(6506007)(6916009)(2906002)(8936002)(81166007)(186003)(5660300002)(82740400003)(8676002)(69590400007)(86362001)(47076004)(316002)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 5ec3ddf1-3b4a-45f4-f8b0-08d7f65d5287 X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M4RPL2SPAwZzBmI1JiwLQzc/BSGaDHLhlEYzIPKj/W0jTnYBa748Q9weAnAUy4UteJLm5D5pSZCphaz5jraAxko0hTQxbJMApb2fVzNDkpNNoryK6raareI/DpZlSKUIYG1j3nKkELUvif7MAFkt/kHbcHj1PXxhvb2q9lDyRju9mgfwQD9r0JSfgEpy8+cAeAjpitiVuxCTjXqHU7YKC3HGUlDG9XCBMQSC6jwPOtyA80Uh6bnaZSasuAQoafzmXrA/H8Ppxe+bVE1kIy1KKgUD6zWRxEFnv/2tjpM/z4yD1DDtRKdnRs9z4jVGUMYUYs10/JocYQcj/+ftdnbPQprZF7JbGRzczmYdt+r0orDRWZKCAqUyA7Y51Axp6skvcvQ/l/+hr5/wW8mzo1X0XZ0KKEJylkbe+q+qyrtv7mJsoScC3GR7GT1tzNsoMw8SusAJqLODGopqpIj6z4/NbaJGarw8hmP0Z63KjGJSyuCiGWVMHUgyxHQ4sv8DgsC3fmFLzH6gKdiMEHBi/1TY09l4ba8kwoDfMlSJCPBF9GepasJjZ7PUrGa6SKj0FAgQi4SuJLcK0/jibPRwEcl6GRwz2Wb7GL67+Q3aturvXFIlbdVostBB0POsmlmp0PpFQVVOHcIUU5KyJzz4Klg5RA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:04.1908 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3451d0d6-2c86-4c99-b314-08d7f65d56a0 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2435 X-Spam-Status: No, score=-20.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Check BTI support in the compiler and linker. The check also requires READELF that understands the BTI GNU property note. It is expected to succeed with gcc >=gcc-9 configured with --enable-standard-branch-protection and binutils >=binutils-2.33. --- config.h.in | 3 +++ sysdeps/aarch64/configure | 42 ++++++++++++++++++++++++++++++++++++ sysdeps/aarch64/configure.ac | 19 ++++++++++++++++ 3 files changed, 64 insertions(+) diff --git a/config.h.in b/config.h.in index dea43df438..506b0c416c 100644 --- a/config.h.in +++ b/config.h.in @@ -109,6 +109,9 @@ /* AArch64 big endian ABI */ #undef HAVE_AARCH64_BE +/* AArch64 BTI support enabled. */ +#undef HAVE_AARCH64_BTI + /* C-SKY ABI version. */ #undef CSKYABI diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure index 5bd355a691..70477a7fa5 100644 --- a/sysdeps/aarch64/configure +++ b/sysdeps/aarch64/configure @@ -172,3 +172,45 @@ else config_vars="$config_vars default-abi = lp64" fi + +# Only consider BTI supported if -mbranch-protection=bti is +# on by default in the compiler and the linker produces +# binaries with GNU property notes in PT_GNU_PROPERTY segment. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BTI support" >&5 +$as_echo_n "checking for BTI support... " >&6; } +if ${libc_cv_aarch64_bti+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } \ + && { ac_try='$READELF -lW conftest.so | grep -q GNU_PROPERTY' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } \ + && { ac_try='$READELF -nW conftest.so | grep -q "NT_GNU_PROPERTY_TYPE_0.*AArch64 feature:.* BTI"' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + libc_cv_aarch64_bti=yes + fi + rm -rf conftest.* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_bti" >&5 +$as_echo "$libc_cv_aarch64_bti" >&6; } +if test $libc_cv_aarch64_bti = yes; then + $as_echo "#define HAVE_AARCH64_BTI 1" >>confdefs.h + +fi diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac index 7851dd4dac..798f494740 100644 --- a/sysdeps/aarch64/configure.ac +++ b/sysdeps/aarch64/configure.ac @@ -20,3 +20,22 @@ if test $libc_cv_aarch64_be = yes; then else LIBC_CONFIG_VAR([default-abi], [lp64]) fi + +# Only consider BTI supported if -mbranch-protection=bti is +# on by default in the compiler and the linker produces +# binaries with GNU property notes in PT_GNU_PROPERTY segment. +AC_CACHE_CHECK([for BTI support], [libc_cv_aarch64_bti], [dnl + cat > conftest.c < X-Patchwork-Id: 38961 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E26A5395443B; Tue, 12 May 2020 10:15:12 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130044.outbound.protection.outlook.com [40.107.13.44]) by sourceware.org (Postfix) with ESMTPS id B18E9383F846 for ; Tue, 12 May 2020 10:15:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B18E9383F846 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=TXwxaKtNa5cfJD/yM5jtlVVPc+/uEMumxjRuCvBGLvY=; b=pDHs5f1C8O5jy31kbc0BNQEeBy8Rf9lD02pc199nU6DTLZmf67Fv2COerXVXCh9XyHDlgdorEc2RdsJnArE7kAhO/71x3L5CBBLmZszlfP5UDmFIR9zUrLpNwsXfEk/9j07Gmzml1nYxofbDgTKgCk/CopPfTUx2yNAJYQyP1v4= Received: from DB6PR0202CA0005.eurprd02.prod.outlook.com (2603:10a6:4:29::15) by AM0PR08MB3091.eurprd08.prod.outlook.com (2603:10a6:208:60::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:15:05 +0000 Received: from DB5EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:29:cafe::51) by DB6PR0202CA0005.outlook.office365.com (2603:10a6:4:29::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28 via Frontend Transport; Tue, 12 May 2020 10:15:05 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT019.mail.protection.outlook.com (10.152.20.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:05 +0000 Received: ("Tessian outbound fb9de21a7e90:v54"); Tue, 12 May 2020 10:15:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 023b3ac4503c223d X-CR-MTA-TID: 64aa7808 Received: from 136d48774594.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 24E91E7E-A3D8-4A51-9C57-529D49D48D62.1; Tue, 12 May 2020 10:14:59 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 136d48774594.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:14:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=azSiPULyEL/mStlBjUeaJOvSviG76NlTtkbNbI3Lc3fFkF+It8s/uteOUfA0h6J3bUxPAt6+tFFS9tb173Lvg13RD25iwBoyljMZfylGFZUNcTTt4wsYLTiwmRelxyzofuCb48Dw5JBbKp77htjBidA5t8lrt+xG4qAT0rldlcSwP0yv2E8pJw8WCH9wSmAEb3sgOj7gfZhQAagg+XqBMOAgS4ymjmTTKlBZFAm0Rqm8OfIB+q23lF1EDoxC0naXxKy4GgYX/12gUJcR3CHHe8b1YlC1tKnWNsJFMBgYxLE3aZkCX9W8F97v0dFhCipmB5kPCvgEOQfJIH7fV4+Oqw== 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-SenderADCheck; bh=TXwxaKtNa5cfJD/yM5jtlVVPc+/uEMumxjRuCvBGLvY=; b=fhqfRGa8mvDH4O8JM8YnewIJ4hhb4L7OgKc4A9Uyn2e11He9krpkUjPfjGovDhP5IbGrpseELMvR1GXMtuyNfX3RSa1loyniTjlBvSQLMZDN6oM9Pev4+cir6UfC7aZFoxhSaf6Hvk85aokfy52ykKSwJyXrBIJBYtWJrAEG3zrQJfZ0ajngy4XMuEP+WE+9d7NdIlczvxKAadYEHshLs+GFi5N0G7WiXgO5RmOxORV0WWiDJkGZLt9JNBE+agWX3gzkcuvGofC/JRZ7Z2w5lI369paPdH75le+lGSgWtCaLgAEtGYwsAjv2rhMc0L9EBsQS5kcr6Ehq+TNaZq8Cag== 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=TXwxaKtNa5cfJD/yM5jtlVVPc+/uEMumxjRuCvBGLvY=; b=pDHs5f1C8O5jy31kbc0BNQEeBy8Rf9lD02pc199nU6DTLZmf67Fv2COerXVXCh9XyHDlgdorEc2RdsJnArE7kAhO/71x3L5CBBLmZszlfP5UDmFIR9zUrLpNwsXfEk/9j07Gmzml1nYxofbDgTKgCk/CopPfTUx2yNAJYQyP1v4= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:14:58 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:14:58 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 05/13] aarch64: Add BTI landing pads to assembly code Date: Tue, 12 May 2020 11:14:41 +0100 Message-Id: <14aaaaef4986ecda5edc2659d87934dcd8cc7933.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:14:57 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 89c0bb54-ed19-40fb-abe0-08d7f65d5723 X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|AM6PR08MB2982:|AM0PR08MB3091: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: lPGTHtSYv+ibwM5mveSGGKQkygswgknGeYt9K5xNe0pB+7mp3chAleII4EPtGHt59QT1ZQZZw6wne25J8iEYVBhbbqOxp67Ebu+ZDZDS3R7k4wj0yDNYFo0zE+vNiFqDF+ZsXOpemZpCt2J32IxcyGu524YRLhsZJWgA9+CzeY/jd7Ioc0sZeJEH6EJy/DaCiuQU0vYUPIUg7nHApdTVLBcR/FhcdRDoDZdbvVEzitRHt7psBcd/MZDVsq7iTI8LInpjIJbsTC+89uAXJFXmwrBFmYkK9bxLhgex+G/c41zY7eVSgoh2MJEqEWMKG1iXJO6Bm/dSEHg9O5OxceVG7eyzPUZMS7RmdPkAyK8NZj03aCg+dSTnhNknrkPEiHJFeK8QDuHb1esGk6OpBTNzgvTHrVyukhcL3hPSC3dZwYfMuc+++PY8EWxWl15xp69hl2q7/59BfLg3TVp/rWU3wZMiNwny2FYTf+4CKUwSElWqNKOmRmgz67hq/fXAFp2P7q5izorx8ZzLXpgONZMPRJ8rRGhPVAzrqgkZhcwp2fT7qfW5BsTu7jc7O5C948dwu+vVj1/WnJClHa/55Qt/rnaRetvjubXBjF8EfP4111xmNR3utjMnF5S/SOIwQ69ubXCcwGTpbqCu1Mi3iiW7lPCL11NkarxlhL1ZSTx6vCAtg3h3SvVKCPhZiFAZ6tWf X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(30864003)(36756003)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(4326008)(33440700001)(6666004)(478600001)(6506007)(6512007)(8936002)(26005)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: PQJsibyFafOuiBWfHSdfHQpl0aqFhKqPEH1+D0NN3P3me+R+7R10HvEWn5E4LhlkmUy66Tya3QMFXSwyN/SE4qHZNTMAbPzuGPkj/2NpPlpDYN6ewJBm8YW1t8FpPoiNO7QuzH5DOZkR98/i3Orfigh/FawIO5YOIbwnSBZLsZcQ3uLkzMEdK4TcuXSnmeEHyvsl004BAJjnl8hFGpg+CBNJkXVvpdz1opkttk3ADL+QFUQkfKBP0cTlJhVTGF1G4hRgPoT9jjl0ma+edQWyijR5jF/X8d84f6VO8OAx41xjkAqk3Cc5ca5wVQUE39yEJQazWTItc4E2G9j165g+aBHe6HSjgaT6myI+ET0KShB+wVR4yMWVbne0oavYT/5q9v6VWYuyZv1DpcdPktt9BU6CVZsMaXPqhAMtAyjcwlwb6eUCHDUoy7FqUFU8wmtWkN/39NfoMhPBeJ/10qQYAK1HBE+4B1llv4zkh1o0cvsTNSKdyl/csCDq2hQRX2lR X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT019.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(396003)(39860400002)(136003)(346002)(376002)(46966005)(33430700001)(70206006)(33440700001)(336012)(6486002)(6512007)(2906002)(8676002)(316002)(44832011)(186003)(16526019)(70586007)(81166007)(6506007)(356005)(82740400003)(36756003)(82310400002)(69590400007)(2616005)(5660300002)(6666004)(47076004)(26005)(30864003)(86362001)(956004)(8936002)(6916009)(4326008)(478600001)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 61c0dea0-d8a4-4984-cc73-08d7f65d52cf X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MIDdVaRVNUePQIDfHQrIn4flAPOsw1a5alb7fnzLxqNAKlLYYTligzaC3821shsYocdIYGGn9nd1ZNRAJM/Ik8OeKTdXnXHwPg0CUmge8A+6Ylo/1cvhNdeI3R9WAugn9XhBSDatmZWbfiOk5uGo17I8trY7C6HCebrYThZVllzo8eQHfGQiFS5UG3MkR0XUglTktIIwZ1KBiEH9shJhZPOpo+2NzmUlQfzcoNQndt9p0LAEEv69j6TBzItB2Ta3CKLKxNolw+piQHgRBvrtJJreYeq0VKawfknPjN1wogm8oTWkyQMxEYLSe2l6HRpL+5WGgDrER4nvfgdJuhwsk1GzjPtgVqa+xfbk+kYfctUGYFbA5p8VRgaq5l/XdQuTXcqxMmKai5OyplO2OFT0pOXnMIyn5ylCAo53Tg24LOE3IZF6bVjBCSUy79NaQYpnfQcjKvGJf53nfy/gz2BFF9XNnnwRHiiUBXwnnIVUuJ+EpbOWEVQWUh6+EtbDZvIZk2TH1Y8e4jakKl5lPiAYukI+5S+Fqs6tAUXtlh1toEGY6HiqXUK/NxF3pfsZHbd1/QJvFwY/D8GYdS0Xx610tDYjmqsi2GhCikPiTY1kNKSTzFLtClO/wg1pPi090WXwAqFMow+rMb/ViONtfgPvIg/2WsFjL1Y/Xx1DD7oW3enb0mjZ0LbulhdawUtRunTe4/aAysuRQwrQbno1aSnHRF5OFFGLD0nE3/ENaaYJF6M= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:05.0461 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89c0bb54-ed19-40fb-abe0-08d7f65d5723 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3091 X-Spam-Status: No, score=-19.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, KAM_STOCKGEN, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Cc: Sudakshina Das Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" From: Sudakshina Das To enable building glibc with branch protection, assembly code needs BTI landing pads and ELF object file markings in the form of a GNU property note. The landing pads are unconditionally added to all functions that may be indirectly called. When the code segment is not mapped with PROT_BTI these instructions are nops. They are kept in the code when BTI is not supported so that the layout of performance critical code is unchanged across configurations. The GNU property notes are only added when there is support for BTI in the toolchain, because old binutils does not handle the notes right. (Does not know how to merge them nor to put them in PT_GNU_PROPERTY segment instead of PT_NOTE, and some versions of binutils emit warnings about the unknown GNU property. In such cases the produced libc binaries would not have the right ELF marking so BTI would not be enabled.) Note: functions using ENTRY or ENTRY_ALIGN now start with an additional BTI c, so alignment of the following code changes, but ENTRY_ALIGN_AND_PAD was fixed so there is no change to the existing code layout. Some string functions may need to be tuned for optimal performance after this commit. Co-authored-by: Szabolcs Nagy TODO: how to add property notes to asm: use END_FILE macro or other macro (with descriptive name) or add them in sysdep.h --- sysdeps/aarch64/__longjmp.S | 1 + sysdeps/aarch64/crti.S | 4 +++ sysdeps/aarch64/crtn.S | 4 +++ sysdeps/aarch64/dl-tlsdesc.S | 5 +++ sysdeps/aarch64/dl-trampoline.S | 4 +++ sysdeps/aarch64/memchr.S | 1 + sysdeps/aarch64/memcmp.S | 1 + sysdeps/aarch64/memcpy.S | 1 + sysdeps/aarch64/memrchr.S | 1 + sysdeps/aarch64/memset.S | 1 + sysdeps/aarch64/multiarch/memchr_nosimd.S | 1 + sysdeps/aarch64/multiarch/memcpy_falkor.S | 1 + sysdeps/aarch64/multiarch/memcpy_thunderx.S | 1 + sysdeps/aarch64/multiarch/memcpy_thunderx2.S | 1 + sysdeps/aarch64/multiarch/memmove_falkor.S | 1 + sysdeps/aarch64/multiarch/memset_base64.S | 1 + sysdeps/aarch64/multiarch/memset_kunpeng.S | 1 + sysdeps/aarch64/multiarch/strlen_asimd.S | 1 + sysdeps/aarch64/rawmemchr.S | 1 + sysdeps/aarch64/setjmp.S | 1 + sysdeps/aarch64/start.S | 2 ++ sysdeps/aarch64/strchr.S | 1 + sysdeps/aarch64/strchrnul.S | 1 + sysdeps/aarch64/strcmp.S | 1 + sysdeps/aarch64/strcpy.S | 1 + sysdeps/aarch64/strlen.S | 1 + sysdeps/aarch64/strncmp.S | 1 + sysdeps/aarch64/strnlen.S | 1 + sysdeps/aarch64/strrchr.S | 1 + sysdeps/aarch64/sysdep.h | 32 ++++++++++++++++++- sysdeps/unix/sysv/linux/aarch64/__read_tp.S | 1 + sysdeps/unix/sysv/linux/aarch64/clone.S | 1 + sysdeps/unix/sysv/linux/aarch64/getcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/ioctl.S | 1 + .../unix/sysv/linux/aarch64/libc-__read_tp.S | 1 + sysdeps/unix/sysv/linux/aarch64/setcontext.S | 1 + sysdeps/unix/sysv/linux/aarch64/syscall.S | 1 + sysdeps/unix/sysv/linux/aarch64/vfork.S | 1 + 38 files changed, 82 insertions(+), 1 deletion(-) diff --git a/sysdeps/aarch64/__longjmp.S b/sysdeps/aarch64/__longjmp.S index f9060776b4..362171cdb8 100644 --- a/sysdeps/aarch64/__longjmp.S +++ b/sysdeps/aarch64/__longjmp.S @@ -116,3 +116,4 @@ ENTRY (__longjmp) /* Use br instead of ret because ret is guaranteed to mispredict */ br x30 END (__longjmp) +END_FILE diff --git a/sysdeps/aarch64/crti.S b/sysdeps/aarch64/crti.S index 1728eac37a..89a9e25f5b 100644 --- a/sysdeps/aarch64/crti.S +++ b/sysdeps/aarch64/crti.S @@ -75,6 +75,7 @@ call_weak_fn: .hidden _init .type _init, %function _init: + BTI_C stp x29, x30, [sp, -16]! mov x29, sp #if PREINIT_FUNCTION_WEAK @@ -89,5 +90,8 @@ _init: .hidden _fini .type _fini, %function _fini: + BTI_C stp x29, x30, [sp, -16]! mov x29, sp + +END_FILE diff --git a/sysdeps/aarch64/crtn.S b/sysdeps/aarch64/crtn.S index c3e97cc449..94a6f970ef 100644 --- a/sysdeps/aarch64/crtn.S +++ b/sysdeps/aarch64/crtn.S @@ -37,6 +37,8 @@ /* crtn.S puts function epilogues in the .init and .fini sections corresponding to the prologues in crti.S. */ +#include + .section .init,"ax",%progbits ldp x29, x30, [sp], 16 RET @@ -44,3 +46,5 @@ .section .fini,"ax",%progbits ldp x29, x30, [sp], 16 RET + +END_FILE diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S index 557ad1d505..d55e0443aa 100644 --- a/sysdeps/aarch64/dl-tlsdesc.S +++ b/sysdeps/aarch64/dl-tlsdesc.S @@ -74,6 +74,7 @@ cfi_startproc .align 2 _dl_tlsdesc_return: + BTI_C DELOUSE (0) ldr PTR_REG (0), [x0, #PTR_SIZE] RET @@ -95,6 +96,7 @@ _dl_tlsdesc_return: cfi_startproc .align 2 _dl_tlsdesc_undefweak: + BTI_C str x1, [sp, #-16]! cfi_adjust_cfa_offset (16) DELOUSE (0) @@ -142,6 +144,7 @@ _dl_tlsdesc_undefweak: cfi_startproc .align 2 _dl_tlsdesc_dynamic: + BTI_C DELOUSE (0) /* Save just enough registers to support fast path, if we fall @@ -235,3 +238,5 @@ _dl_tlsdesc_dynamic: .size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic # undef NSAVEXREGPAIRS #endif + +END_FILE diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S index 94e965c096..fba5689d09 100644 --- a/sysdeps/aarch64/dl-trampoline.S +++ b/sysdeps/aarch64/dl-trampoline.S @@ -35,6 +35,7 @@ cfi_startproc .align 2 _dl_runtime_resolve: + BTI_C /* AArch64 we get called with: ip0 &PLTGOT[2] ip1 temp(dl resolver entry point) @@ -126,6 +127,7 @@ _dl_runtime_resolve: cfi_startproc .align 2 _dl_runtime_profile: + BTI_C /* AArch64 we get called with: ip0 &PLTGOT[2] ip1 temp(dl resolver entry point) @@ -298,3 +300,5 @@ _dl_runtime_profile: .size _dl_runtime_profile, .-_dl_runtime_profile #endif .previous + +END_FILE diff --git a/sysdeps/aarch64/memchr.S b/sysdeps/aarch64/memchr.S index 85c65cbfca..c67a31223f 100644 --- a/sysdeps/aarch64/memchr.S +++ b/sysdeps/aarch64/memchr.S @@ -159,3 +159,4 @@ L(zero_length): END (MEMCHR) weak_alias (MEMCHR, memchr) libc_hidden_builtin_def (memchr) +END_FILE diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S index 827f54f99e..c6e07f9287 100644 --- a/sysdeps/aarch64/memcmp.S +++ b/sysdeps/aarch64/memcmp.S @@ -178,3 +178,4 @@ END (memcmp) #undef bcmp weak_alias (memcmp, bcmp) libc_hidden_builtin_def (memcmp) +END_FILE diff --git a/sysdeps/aarch64/memcpy.S b/sysdeps/aarch64/memcpy.S index e0b4c4502f..543d9417f3 100644 --- a/sysdeps/aarch64/memcpy.S +++ b/sysdeps/aarch64/memcpy.S @@ -282,3 +282,4 @@ L(copy64_from_start): END (MEMMOVE) libc_hidden_builtin_def (MEMMOVE) +END_FILE diff --git a/sysdeps/aarch64/memrchr.S b/sysdeps/aarch64/memrchr.S index ace5a94e8f..f35a68d14d 100644 --- a/sysdeps/aarch64/memrchr.S +++ b/sysdeps/aarch64/memrchr.S @@ -163,3 +163,4 @@ L(zero_length): END (__memrchr) weak_alias (__memrchr, memrchr) libc_hidden_builtin_def (memrchr) +END_FILE diff --git a/sysdeps/aarch64/memset.S b/sysdeps/aarch64/memset.S index ac577f1660..7cdae20563 100644 --- a/sysdeps/aarch64/memset.S +++ b/sysdeps/aarch64/memset.S @@ -189,3 +189,4 @@ L(zva_other): END (MEMSET) libc_hidden_builtin_def (MEMSET) +END_FILE diff --git a/sysdeps/aarch64/multiarch/memchr_nosimd.S b/sysdeps/aarch64/multiarch/memchr_nosimd.S index 41ce10eb32..6d7d38d5bb 100644 --- a/sysdeps/aarch64/multiarch/memchr_nosimd.S +++ b/sysdeps/aarch64/multiarch/memchr_nosimd.S @@ -221,3 +221,4 @@ L(none_chr): END (MEMCHR) libc_hidden_builtin_def (MEMCHR) +END_FILE diff --git a/sysdeps/aarch64/multiarch/memcpy_falkor.S b/sysdeps/aarch64/multiarch/memcpy_falkor.S index 35a1fae1b9..999aa48b16 100644 --- a/sysdeps/aarch64/multiarch/memcpy_falkor.S +++ b/sysdeps/aarch64/multiarch/memcpy_falkor.S @@ -188,4 +188,5 @@ L(last64): END (__memcpy_falkor) libc_hidden_builtin_def (__memcpy_falkor) +END_FILE #endif diff --git a/sysdeps/aarch64/multiarch/memcpy_thunderx.S b/sysdeps/aarch64/multiarch/memcpy_thunderx.S index e9407571b5..e6e36a6633 100644 --- a/sysdeps/aarch64/multiarch/memcpy_thunderx.S +++ b/sysdeps/aarch64/multiarch/memcpy_thunderx.S @@ -318,5 +318,6 @@ L(move_long): END (MEMCPY) libc_hidden_builtin_def (MEMCPY) +END_FILE #endif diff --git a/sysdeps/aarch64/multiarch/memcpy_thunderx2.S b/sysdeps/aarch64/multiarch/memcpy_thunderx2.S index 68e99455c8..fde4c7198c 100644 --- a/sysdeps/aarch64/multiarch/memcpy_thunderx2.S +++ b/sysdeps/aarch64/multiarch/memcpy_thunderx2.S @@ -474,4 +474,5 @@ L(ext_table): .word L(ext_size_15) -. libc_hidden_builtin_def (MEMCPY) +END_FILE #endif diff --git a/sysdeps/aarch64/multiarch/memmove_falkor.S b/sysdeps/aarch64/multiarch/memmove_falkor.S index 35fc1fdd41..d8cc992d27 100644 --- a/sysdeps/aarch64/multiarch/memmove_falkor.S +++ b/sysdeps/aarch64/multiarch/memmove_falkor.S @@ -223,3 +223,4 @@ L(move_long): END (__memmove_falkor) libc_hidden_builtin_def (__memmove_falkor) +END_FILE diff --git a/sysdeps/aarch64/multiarch/memset_base64.S b/sysdeps/aarch64/multiarch/memset_base64.S index 8f85cd1caf..ee0b832ef9 100644 --- a/sysdeps/aarch64/multiarch/memset_base64.S +++ b/sysdeps/aarch64/multiarch/memset_base64.S @@ -184,3 +184,4 @@ L(zva_64): END (MEMSET) libc_hidden_builtin_def (MEMSET) +END_FILE diff --git a/sysdeps/aarch64/multiarch/memset_kunpeng.S b/sysdeps/aarch64/multiarch/memset_kunpeng.S index 8e051d4fd1..aa7ab62fdd 100644 --- a/sysdeps/aarch64/multiarch/memset_kunpeng.S +++ b/sysdeps/aarch64/multiarch/memset_kunpeng.S @@ -111,3 +111,4 @@ L(set_long): END (MEMSET) libc_hidden_builtin_def (MEMSET) #endif +END_FILE diff --git a/sysdeps/aarch64/multiarch/strlen_asimd.S b/sysdeps/aarch64/multiarch/strlen_asimd.S index 236a2c96a6..c28aa0ca8d 100644 --- a/sysdeps/aarch64/multiarch/strlen_asimd.S +++ b/sysdeps/aarch64/multiarch/strlen_asimd.S @@ -176,3 +176,4 @@ L(page_cross): END (__strlen_asimd) weak_alias (__strlen_asimd, strlen_asimd) libc_hidden_builtin_def (strlen_asimd) +END_FILE diff --git a/sysdeps/aarch64/rawmemchr.S b/sysdeps/aarch64/rawmemchr.S index 5c7a664fb4..4ad614a169 100644 --- a/sysdeps/aarch64/rawmemchr.S +++ b/sysdeps/aarch64/rawmemchr.S @@ -40,3 +40,4 @@ L(do_strlen): END (__rawmemchr) weak_alias (__rawmemchr, rawmemchr) libc_hidden_builtin_def (__rawmemchr) +END_FILE diff --git a/sysdeps/aarch64/setjmp.S b/sysdeps/aarch64/setjmp.S index 28fdd3f46a..9a0201ef70 100644 --- a/sysdeps/aarch64/setjmp.S +++ b/sysdeps/aarch64/setjmp.S @@ -73,3 +73,4 @@ ENTRY (__sigsetjmp) #endif END (__sigsetjmp) hidden_def (__sigsetjmp) +END_FILE diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S index d96cf57e2d..e6c0393c20 100644 --- a/sysdeps/aarch64/start.S +++ b/sysdeps/aarch64/start.S @@ -46,6 +46,7 @@ .globl _start .type _start,#function _start: + BTI_C /* Create an initial frame with 0 LR and FP */ mov x29, #0 mov x30, #0 @@ -110,3 +111,4 @@ __data_start: .long 0 .weak data_start data_start = __data_start +END_FILE diff --git a/sysdeps/aarch64/strchr.S b/sysdeps/aarch64/strchr.S index 4a75e73945..e1f98aa42c 100644 --- a/sysdeps/aarch64/strchr.S +++ b/sysdeps/aarch64/strchr.S @@ -137,3 +137,4 @@ L(tail): END (strchr) libc_hidden_builtin_def (strchr) weak_alias (strchr, index) +END_FILE diff --git a/sysdeps/aarch64/strchrnul.S b/sysdeps/aarch64/strchrnul.S index a65be6cba8..a9ccc54205 100644 --- a/sysdeps/aarch64/strchrnul.S +++ b/sysdeps/aarch64/strchrnul.S @@ -129,3 +129,4 @@ L(tail): END(__strchrnul) weak_alias (__strchrnul, strchrnul) +END_FILE diff --git a/sysdeps/aarch64/strcmp.S b/sysdeps/aarch64/strcmp.S index d044c29e9b..a7bee697c0 100644 --- a/sysdeps/aarch64/strcmp.S +++ b/sysdeps/aarch64/strcmp.S @@ -182,3 +182,4 @@ L(done): RET END(strcmp) libc_hidden_builtin_def (strcmp) +END_FILE diff --git a/sysdeps/aarch64/strcpy.S b/sysdeps/aarch64/strcpy.S index 548130e413..631da4a358 100644 --- a/sysdeps/aarch64/strcpy.S +++ b/sysdeps/aarch64/strcpy.S @@ -321,3 +321,4 @@ libc_hidden_builtin_def (stpcpy) #else libc_hidden_builtin_def (strcpy) #endif +END_FILE diff --git a/sysdeps/aarch64/strlen.S b/sysdeps/aarch64/strlen.S index e01fab7c2a..3af25de4b8 100644 --- a/sysdeps/aarch64/strlen.S +++ b/sysdeps/aarch64/strlen.S @@ -222,3 +222,4 @@ L(page_cross): END (STRLEN) weak_alias (STRLEN, strlen) libc_hidden_builtin_def (strlen) +END_FILE diff --git a/sysdeps/aarch64/strncmp.S b/sysdeps/aarch64/strncmp.S index c5141fab8a..d289d4a3ba 100644 --- a/sysdeps/aarch64/strncmp.S +++ b/sysdeps/aarch64/strncmp.S @@ -270,3 +270,4 @@ L(ret0): END (strncmp) libc_hidden_builtin_def (strncmp) +END_FILE diff --git a/sysdeps/aarch64/strnlen.S b/sysdeps/aarch64/strnlen.S index 5981247dd9..964536dba9 100644 --- a/sysdeps/aarch64/strnlen.S +++ b/sysdeps/aarch64/strnlen.S @@ -213,3 +213,4 @@ END (__strnlen) libc_hidden_def (__strnlen) weak_alias (__strnlen, strnlen) libc_hidden_def (strnlen) +END_FILE diff --git a/sysdeps/aarch64/strrchr.S b/sysdeps/aarch64/strrchr.S index 94da08d351..9f6d956f21 100644 --- a/sysdeps/aarch64/strrchr.S +++ b/sysdeps/aarch64/strrchr.S @@ -164,3 +164,4 @@ L(null_search): END(strrchr) weak_alias (strrchr, rindex) libc_hidden_builtin_def (strrchr) +END_FILE diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index 604c489170..161d63c782 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -41,12 +41,40 @@ #define ASM_SIZE_DIRECTIVE(name) .size name,.-name +/* Branch Target Identitication support. */ +#define BTI_C hint 34 +#define BTI_J hint 36 + +#define FEATURE_1_BTI 1 +#define FEATURE_1_PAC 2 + +/* Add a GNU_PROPERTY_AARCH64_FEATURE_1_AND note. */ +#define GNU_PROPERTY(features) \ + .section .note.gnu.property, "a"; \ + .p2align 3; \ + .word 4; \ + .word 16; \ + .word 5; \ + .asciz "GNU"; \ + .word 0xc0000000; \ + .word 4; \ + .word features; \ + .word 0; + +/* GNU property note with the supported features. */ +#ifdef HAVE_AARCH64_BTI +# define END_FILE GNU_PROPERTY (FEATURE_1_BTI) +#else +# define END_FILE +#endif + /* Define an entry point visible from C. */ #define ENTRY(name) \ .globl C_SYMBOL_NAME(name); \ .type C_SYMBOL_NAME(name),%function; \ .align 4; \ C_LABEL(name) \ + BTI_C; \ cfi_startproc; \ CALL_MCOUNT @@ -56,6 +84,7 @@ .type C_SYMBOL_NAME(name),%function; \ .p2align align; \ C_LABEL(name) \ + BTI_C; \ cfi_startproc; \ CALL_MCOUNT @@ -68,10 +97,11 @@ .globl C_SYMBOL_NAME(name); \ .type C_SYMBOL_NAME(name),%function; \ .p2align align; \ - .rep padding; \ + .rep padding - 1; /* -1 for bti c. */ \ nop; \ .endr; \ C_LABEL(name) \ + BTI_C; \ cfi_startproc; \ CALL_MCOUNT diff --git a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S index 12e1131fe7..7825aa5e1b 100644 --- a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S +++ b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S @@ -23,3 +23,4 @@ ENTRY (__read_tp) mrs x0, tpidr_el0 RET END (__read_tp) +END_FILE diff --git a/sysdeps/unix/sysv/linux/aarch64/clone.S b/sysdeps/unix/sysv/linux/aarch64/clone.S index 2b14106fd1..15b5a7b217 100644 --- a/sysdeps/unix/sysv/linux/aarch64/clone.S +++ b/sysdeps/unix/sysv/linux/aarch64/clone.S @@ -85,3 +85,4 @@ thread_start: libc_hidden_def (__clone) weak_alias (__clone, clone) +END_FILE diff --git a/sysdeps/unix/sysv/linux/aarch64/getcontext.S b/sysdeps/unix/sysv/linux/aarch64/getcontext.S index 8571556189..95f61d5f28 100644 --- a/sysdeps/unix/sysv/linux/aarch64/getcontext.S +++ b/sysdeps/unix/sysv/linux/aarch64/getcontext.S @@ -107,3 +107,4 @@ ENTRY(__getcontext) PSEUDO_END (__getcontext) weak_alias (__getcontext, getcontext) +END_FILE diff --git a/sysdeps/unix/sysv/linux/aarch64/ioctl.S b/sysdeps/unix/sysv/linux/aarch64/ioctl.S index ed36e309c4..19abf43726 100644 --- a/sysdeps/unix/sysv/linux/aarch64/ioctl.S +++ b/sysdeps/unix/sysv/linux/aarch64/ioctl.S @@ -30,3 +30,4 @@ PSEUDO_END (__ioctl) libc_hidden_def (__ioctl) weak_alias (__ioctl, ioctl) +END_FILE diff --git a/sysdeps/unix/sysv/linux/aarch64/libc-__read_tp.S b/sysdeps/unix/sysv/linux/aarch64/libc-__read_tp.S index 6de259ed83..df5eec8599 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc-__read_tp.S +++ b/sysdeps/unix/sysv/linux/aarch64/libc-__read_tp.S @@ -17,3 +17,4 @@ . */ #include <__read_tp.S> +END_FILE diff --git a/sysdeps/unix/sysv/linux/aarch64/setcontext.S b/sysdeps/unix/sysv/linux/aarch64/setcontext.S index 61fb813db3..d9d6c0f364 100644 --- a/sysdeps/unix/sysv/linux/aarch64/setcontext.S +++ b/sysdeps/unix/sysv/linux/aarch64/setcontext.S @@ -128,3 +128,4 @@ ENTRY (__startcontext) cbnz x0, __setcontext 1: b HIDDEN_JUMPTARGET (exit) END (__startcontext) +END_FILE diff --git a/sysdeps/unix/sysv/linux/aarch64/syscall.S b/sysdeps/unix/sysv/linux/aarch64/syscall.S index 993e307fcf..10e59ece58 100644 --- a/sysdeps/unix/sysv/linux/aarch64/syscall.S +++ b/sysdeps/unix/sysv/linux/aarch64/syscall.S @@ -42,3 +42,4 @@ ENTRY (syscall) 1: b SYSCALL_ERROR PSEUDO_END (syscall) +END_FILE diff --git a/sysdeps/unix/sysv/linux/aarch64/vfork.S b/sysdeps/unix/sysv/linux/aarch64/vfork.S index 9c8ea48c5a..0306003a22 100644 --- a/sysdeps/unix/sysv/linux/aarch64/vfork.S +++ b/sysdeps/unix/sysv/linux/aarch64/vfork.S @@ -40,3 +40,4 @@ libc_hidden_def (__vfork) weak_alias (__vfork, vfork) strong_alias (__vfork, __libc_vfork) +END_FILE From patchwork Tue May 12 10:14:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38958 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 29F0C395200F; Tue, 12 May 2020 10:15:11 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50042.outbound.protection.outlook.com [40.107.5.42]) by sourceware.org (Postfix) with ESMTPS id 46458393C8A3 for ; Tue, 12 May 2020 10:15:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 46458393C8A3 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=eLWElF3mAZy1E7ngrHBqKVIH9XhWqMLOAuLRud8Zgog=; b=Ro8mRUu8ZSfJT0/9wdHWeihBeshSNRAqLXbpJg6WwrNyNtqi0vqzVvIFO+XYxc15dg66QV3xesOkTWrBWWiXkujTpRIBbSehkK/8haGWPGgBywopX6SeRx5ToKbI/DNymkICHyOSsRN2sGouH5FZSGkYspvs+CY01l5rSVMfubA= Received: from DB6PR07CA0169.eurprd07.prod.outlook.com (2603:10a6:6:43::23) by DB7PR08MB3052.eurprd08.prod.outlook.com (2603:10a6:5:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27; Tue, 12 May 2020 10:15:06 +0000 Received: from DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:43:cafe::11) by DB6PR07CA0169.outlook.office365.com (2603:10a6:6:43::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.12 via Frontend Transport; Tue, 12 May 2020 10:15:06 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT060.mail.protection.outlook.com (10.152.21.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:06 +0000 Received: ("Tessian outbound 567b75aed2b9:v54"); Tue, 12 May 2020 10:15:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fad20a7b1893a3de X-CR-MTA-TID: 64aa7808 Received: from e915e8b63775.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9A25970B-5C81-42E1-A9A6-4EA1BDFA9596.1; Tue, 12 May 2020 10:14:59 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e915e8b63775.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:14:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lQ5abFypiTVUw5R70AeYpy6oSvd5R/xNpuWPdLsqmrYvEmmEPKj7N0XBbvLWTf5JU323xKhTuKcn/l485KS+iNTZ0+1BnRfMknGL9J0ywHPDZkvU9Vk6P4Aiu31/NYLtvo3X2Ofmoyr/Cdv5OegSSCnSyZwo8jESUpVcNTJ2IVL429PchXYo3wap20kjVglM5EwT75whqDh3Jo4+8lH4r1TeD7iSZvXsFIj/zDnbs0cx/JVhOFKUuaO6LYpClh2VNqBojZLukMK7XkM+2Lx6YtzyRsHnb9aSOmOPf3l6EN+H/HrAYmZ7aMtFrXzJynMPkBkKy7CpuOwLehHP6P5shg== 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-SenderADCheck; bh=eLWElF3mAZy1E7ngrHBqKVIH9XhWqMLOAuLRud8Zgog=; b=b0KgUjtnTjKkXMw/Ypg4zqgujOeZn2vC+qoXGXqm6WlIUbJpvnX5dUSpAA9AM1HGHiYuOEoVSUi5TPEh+izfEwkG8Lp68e4R/+uzzpsBpcZmCWoMM/9X20pIP3MvYxp2nStD7JqcoyMYiXSsTUaiy7edEvtCNHci3d+3iqFBpsILlzqkvjMzk6fHqYKtbfjg950kGthhc/MFYNdYLSbqKSmfAeMvXzbwK4B/OOmHW0yBoXNt2V4rufgSw4gjoEYvhVC6b1cDB16Y7xtsDAZoY4xpdHXhlFb0RqGaL6CZdmkO31oM5ao3HsVlCS/lNrNeHMd1a6rzl0VRtSWzNmv7MQ== 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=eLWElF3mAZy1E7ngrHBqKVIH9XhWqMLOAuLRud8Zgog=; b=Ro8mRUu8ZSfJT0/9wdHWeihBeshSNRAqLXbpJg6WwrNyNtqi0vqzVvIFO+XYxc15dg66QV3xesOkTWrBWWiXkujTpRIBbSehkK/8haGWPGgBywopX6SeRx5ToKbI/DNymkICHyOSsRN2sGouH5FZSGkYspvs+CY01l5rSVMfubA= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:14:58 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:14:58 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 06/13] aarch64: Rename place holder .S files to .c Date: Tue, 12 May 2020 11:14:42 +0100 Message-Id: <9e7ad78ebd393852c83b850cc443f6a3b1c563a3.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:14:58 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 14314937-7d74-4370-1ce7-08d7f65d57e4 X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|DB7PR08MB3052: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: iiojl0Dlq/L7qGCVAFxkaUGBs63WCc5ETtKfjGMzo2uAKw4pV4yj4hgOwGq3PqGIlXnSS1ZLHQGVQj+XEduXWKMsswvE2bwwYa5n2+4CR/O0FheLZqJ8DR5Gn+Rsu9DRve9nz0JIv6IOb6vBSAboQjpqF2Z+4tlXp0h6cuquF9z0xva7tYAABKZkKQBNSUi2zt7i2K9RQFXAdjdRiinTuUyF+mo8x02l4Wo0/GZghBcWSulX4U2Tkb57vYkNdG5lNotApxNOr1EJlOhnCiFmi0q3ROA+g4Y/JetY1vS5lu0UsiDiPlhSpw1yTkp7rULpHC9+SvXskENdGCMK5hmzBdph8tGBprjNLfyWeeP+3yWMf2SbP7/AoH6qTfQrhG5h2SC6dz4alfLljDBrzLx2Lf7Ouyr2/Gi+OfJJDUB29crTAnXZ4sbeckKWs6Zbb7JhlAqE93iiwA76GJOGnLSNXgXAkl8qqQZXocDxrHDo0zLRyXyeQkfPUxNDJYG4H6gnA/TRoqemqPXhq/4z+y3IMF3m5e0yfoE6XpUIvXnn1PeVRelMKMiWvQAmDzkFkbZxu526dwb9i/DGf30TNWADv6eW2TZzIg9J6l9V9VZjViIp5gfJQzY8CbVx4TTUkKhl X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(36756003)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(33440700001)(6666004)(478600001)(6506007)(6512007)(8936002)(26005)(142923001)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: H0PWv8XkH67FXsVK4DzNNTEn2sCpdVpl0xueiPDgf8piuJDYWtmttVeMMC4g0q6YVVV+ALQ8KGAaqZf53UllNs57nVLu7j6Gt1r0QG4hYVHg3zeY+lcUUIQMWRyXz/3bQJdMLnMLet+y1lcXEOczmxuWyQSnSdqHdX8RyZskT/d+8fL6VCI7JZnenOHn3FhdmoYfLADED7gn9SObN4Ebr+VsTAbESBZlrfFTg5BRtoGzrj/Vn/6KKkbdGI3+RWM9TdrFDeAqOD0wkH0p6Ou6j8yBXJSBL5BDqQivQjAbwwuUMWHs5hPCXNP8ro5PaD/gGZCk5Nmq2vawrB78pFKwCG1wEA7oElWOcV87MhUI0u4NrFL4vBqHHDRop9c+oC7636PQs4veXgjuCfdFwwIjXTrCntbZweQkVRxh7GoQL0hVdYfqzRSZcPtRFFq3YQt+j+w8hmmZ1AB17lGBq05NU0P1/HMe3FPBBJRLQPMn7/c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(396003)(346002)(136003)(39860400002)(376002)(46966005)(33430700001)(82310400002)(16526019)(5660300002)(2616005)(6486002)(6506007)(356005)(44832011)(36756003)(33440700001)(26005)(70206006)(956004)(478600001)(70586007)(336012)(6512007)(81166007)(69590400007)(6916009)(186003)(6666004)(2906002)(47076004)(8936002)(8676002)(82740400003)(316002)(86362001)(142923001)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 271099f4-f2c1-4c0a-e9c4-08d7f65d5319 X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iHXAneKApEEQpbDyhI9z9ZP7UVqqDF5kWe1pKAYZ+f0AgUNssm13TqAs4/dGoAyPE0XAnRhH/UYvdbmDrlrIdqkok5awswFOAjho4HyxWUFkIExFY/9HQMgd37Im78Vn0oAZNcr6EuBFsDoXRULHN4sSzdPygghVOL4nX/Av/QKaoRFQF+VtfPet7gDJavU9sNLvDGhCUfyHoVKDKMaifnHW2j1wyHKlUr1XIpxDwfjIwvwbRxhMWxWJHBhedR606oaQ+lME6E0rXQOHFS2gDZeoLxoT5sLWENVjpLm66K4pXtgguBPohT1o7NbcLL2P12Scse3+nxHFPWW1Mq3OeCPJpbBjJ5aPGYdvktcnj+OpEdCvr70b5Vw7dEyeMC3N0QlBOsJbikmt637ECjFV3zdSsqH2ICx9vLOvtx8LJpBYIyD/TJvat91DHs+KTOJ5uNkllMl4EpmWZkbol6SZRrEgJmTJN8vqDohzZqaYrtlvJjl0LVsdB6+zQjWI9Ce3lOUjNoWuEb8Tf8I+hm390ghw8FW5Mc9A4sMT9nnvC1WU+Rkqiws+9w2RQGXmWYuyhMKU3l3s89yPgZfqHzPrEjHcz4uRMGrePEhg4A/E3Y253o4fmv79JE6DBspO14hkwW7qzPIDWtioFFZkvqjDbeuEme3HH8O6PlBnE/pu4MU= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:06.3098 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14314937-7d74-4370-1ce7-08d7f65d57e4 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3052 X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The compiler can add required elf markings based on CFLAGS but the assembler cannot, so using C code for empty files creates less of a maintenance problem. Reviewed-by: Adhemerval Zanella --- sysdeps/aarch64/{bsd-_setjmp.S => bsd-_setjmp.c} | 0 sysdeps/aarch64/{bsd-setjmp.S => bsd-setjmp.c} | 0 sysdeps/aarch64/{memmove.S => memmove.c} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename sysdeps/aarch64/{bsd-_setjmp.S => bsd-_setjmp.c} (100%) rename sysdeps/aarch64/{bsd-setjmp.S => bsd-setjmp.c} (100%) rename sysdeps/aarch64/{memmove.S => memmove.c} (100%) diff --git a/sysdeps/aarch64/bsd-_setjmp.S b/sysdeps/aarch64/bsd-_setjmp.c similarity index 100% rename from sysdeps/aarch64/bsd-_setjmp.S rename to sysdeps/aarch64/bsd-_setjmp.c diff --git a/sysdeps/aarch64/bsd-setjmp.S b/sysdeps/aarch64/bsd-setjmp.c similarity index 100% rename from sysdeps/aarch64/bsd-setjmp.S rename to sysdeps/aarch64/bsd-setjmp.c diff --git a/sysdeps/aarch64/memmove.S b/sysdeps/aarch64/memmove.c similarity index 100% rename from sysdeps/aarch64/memmove.S rename to sysdeps/aarch64/memmove.c From patchwork Tue May 12 10:14:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38962 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A33B2395447D; Tue, 12 May 2020 10:15:13 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40044.outbound.protection.outlook.com [40.107.4.44]) by sourceware.org (Postfix) with ESMTPS id 03FA9393C8A0 for ; Tue, 12 May 2020 10:15:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 03FA9393C8A0 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=gCl6sW7mCoCA//0zWG2acz3tD0gfnzy9/7fzgEUKjyo=; b=QPmBTh6BrbakaVhqaRXd0+PQPCo+i6nl2+JePFnO23AcfHSfPwI51X4Vdvve+CGGLFqxtrpW1mA/6lbJ7/QO9rOqj2kcb7ejkIJ1nZNbl2Xu+GlXhgzSoUoV+gfxTEXtolyMdKzpd6edRtnetlzcWWLZRRcATU/LdjJT+I1yhME= Received: from AM5PR0201CA0015.eurprd02.prod.outlook.com (2603:10a6:203:3d::25) by DB6PR0801MB2023.eurprd08.prod.outlook.com (2603:10a6:4:75::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.33; Tue, 12 May 2020 10:15:06 +0000 Received: from AM5EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:3d:cafe::3e) by AM5PR0201CA0015.outlook.office365.com (2603:10a6:203:3d::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 10:15:06 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT021.mail.protection.outlook.com (10.152.16.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:05 +0000 Received: ("Tessian outbound e88319d7ccd0:v54"); Tue, 12 May 2020 10:15:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b94957e418bd7f38 X-CR-MTA-TID: 64aa7808 Received: from c0d9ef014f6e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3BCA5F99-8A1F-45EA-95D7-65B803DE1C7C.1; Tue, 12 May 2020 10:15:00 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c0d9ef014f6e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:15:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GtbBVnGoTQ1hrSjjkynB1pG6l+IuL1IVpkMiJc6GS0HG3x6XOggMDDmkYL8YShfPHfBxbaTmkdQUWHiDLnEyTwhSUbeRPWUPw3uXuA17/Az0Jlv8E3eGmLFY3tzLvsy86HsaZTVDWDrnGOvy+xS6rzeEnNEvIzgAqnSR7ISk+802awlSKEA5y6BkfiSix3sjwff8WJxHYeouywDrmMfr+v9bBeNappxTyAywOpFKW3WATJtkUcOTIUQRmPLtnHaPNGGd0dMzU9wBUbsHiw4qQJ/SAtC57PYzbV2nx57E2TsPqBgov6z2Zu7w2WBZDvXAE92Vy9M9mw5gHtQNeG1HdQ== 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-SenderADCheck; bh=gCl6sW7mCoCA//0zWG2acz3tD0gfnzy9/7fzgEUKjyo=; b=O3DYl3UPeD8GpckKRJcHDcC+PnFGwhMX0RAx1gcP8og/CfFLvONuo8oPKXb2WBLo3i+teyEXuXYbRV4dQ4zj2cD0Lixb8YsLjNAmlq+0T+WG7ZpqkumkH43rsVsREoGpm9Dh9c6k4sjIKv7oIuF10YVBw4wzlQeqi7qNIAGoFpbgFEp2gy03Eqd0QsAueoChwvZkp3GO/hz2DKANM2Dp3fbXqOgj6ftVOJKvp/dP/J8Vgw+0rrjkIyoXnvBS0OZOeBStWpXr9uZq/6vYma8V1FTzF7Jaj0cRzbypdFK+kZLS0xIX8Bv3djHKaBGVOaMwklrSTMRbgS+W3ZT2vJIp8w== 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=gCl6sW7mCoCA//0zWG2acz3tD0gfnzy9/7fzgEUKjyo=; b=QPmBTh6BrbakaVhqaRXd0+PQPCo+i6nl2+JePFnO23AcfHSfPwI51X4Vdvve+CGGLFqxtrpW1mA/6lbJ7/QO9rOqj2kcb7ejkIJ1nZNbl2Xu+GlXhgzSoUoV+gfxTEXtolyMdKzpd6edRtnetlzcWWLZRRcATU/LdjJT+I1yhME= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:14:59 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:14:59 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 07/13] aarch64: fix swapcontext for BTI Date: Tue, 12 May 2020 11:14:43 +0100 Message-Id: <595544959bbbcb6aeb16c9bd5344a9684788f2cd.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:14:58 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 601d107a-acd3-4207-00a6-08d7f65d57a7 X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|DB6PR0801MB2023: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: PF1kD3dZQnHfpoAjV90xfd2GKsJGTtiM9KlFTthYyLuLdcj+EVnDyKGXlYP5ERk39WM6zN+aWw+kh+IoVI0duJbkNjRf0aw19BT3tdgTpiHQ3BeoED0Ku3lKz78i6H86DgyqvMDxb8TtY7sF8PccocG77z5h8uHZfgZ5LsAuz96p7hV0YlqA9C2c9gIrdENo+OcWVZERLgjiUFx14xhBwjGG677Facnz8UnwtTnavmuiAWJv8+ip/f2bMVrOXxZQUeuq1JPHogCJhe6MYWEvauW9cZ3e/iCHTwhLq6EjKKc089o03hWWi44sI9gIfdx1Aur6s6sjScXIjMqwO1v/L9hvQyUqsBjcnvqYry4ZwT86RCsrLBHAp8VRzEKDyXWsq/lQwnX1d5rFfXkcOXxYEp2SAUMsJtVBraiBLGx2nt3gmlYID/bHJuhtJy6JujOkGyxkzbkRud7TIJWCKZdJiUobc4Uzs3O2xKTN7gXgP0948P7en+qjtA04mH9JDeyyRvDHnMOgEvbEONKDSz0SY8SzbKXePJLKve6VHq++3Fq79QVaUGFOR6vUG9zmUP2XFE1qBoSGhMx2Q0oKC6BY7Yq6UbD+iE/Zb5rwEkojGrU= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(36756003)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(33440700001)(6666004)(478600001)(6506007)(6512007)(8936002)(26005)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: U8BrhvZ/Gp3fVVczO3rfIuWpcZCThZhQa0lm1+i/NWpyzplPhAsU75crdeEJaMf3VVM3ih7PVWLpnafN/OpSUACK+UNCIKh6TWDegmiW/REiBVJkepgS30Ow4WNZ2WGoar88QMAlCLvLERuiIKRLbYWKG0QwQ9Xh6J8Pn8MN+O+jCJbCRz+C2Uzhp7HEBq7ga9mAG0agatVirjoUQUE8eFWccp//RXuNRyJ6SbII2BclPgwcjQMg7YXIH7H7igz3YJFG1wPM3Q/7RvFpjsfnUhfsa4AooxrAU+Fhp/3xOGrcJmnHnF6EZ1nvB5ZAIetoOkId2mqGzXY08H4uyhh/eYAXRiURIyl+ZZiqn3/zx/qrKjs5kYOgqdz20lwd2Xgb/ibd7WHbwdYXKE5V0OStMS2KofjvKYjXt1IYE0MvijqLLgSpBW22FpWMls1QIzbw+gBMhKdm9eF78dwq7kse4ysawGqszD5LJPDQEORgxYtbBbUtDpdNf3g4b1QSomJ3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT021.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(46966005)(33430700001)(186003)(2616005)(336012)(44832011)(2906002)(47076004)(956004)(6666004)(5660300002)(26005)(6916009)(69590400007)(16526019)(6512007)(6506007)(82310400002)(356005)(8676002)(82740400003)(316002)(8936002)(6486002)(36756003)(70206006)(70586007)(33440700001)(86362001)(36906005)(478600001)(81166007)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 06a9072e-6296-4ba4-2202-08d7f65d5358 X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yrk++Ep6KZAyN69He69IH4hI7KAgyCJKidzPHZL57P0mqU6Q7El3nwpWqWgRD1QNpH530umlVFRN746fw0ZGmldDUjgYDnxe8v7cHxgjOabDEyoGjG/aj8hlPp7hxOtrvH8RDz/99H3Z2KnSnlDML8NVnyjlNA/B9uFZZte/8SNqpzwNFhRHz9H7Q+nON8BcSCqnG/oClt5KMqcfmF+PjaJPa+YcFoaykX5FwG6CLk0cBiQCOTbmz4xD0QAJwTcuprSBBBjY4HKQvAFKw45xvRybgFFk4L/YSqiaCV1Aa7lWdUsQkkSyGRs9mCXP8P7ZShIp0oCM66U9A3Z9Qr5WIOv1SyXlTp5VH/DOUCOmf+yraU8Jzzy/6DVH3Bl+xU07fIw9JDqhponaBmsaD9PLGs4VXqS9neQioKL4Y5yulsKovy3zyr5mwUzNWU3CumLMcIPORYEaUh1vywldaLrdl+rJEuXvsTGSDYwleI7v8ryjHLxNgo6ya48UvinjuZ27b2evjgNGZk8dg3IbFbS9RQSziWI5nsOx44u3+L0MhUyRWBGv2/SvQj7CFofy9Pvow5Ncw8aZotlHMPViWzfh+2sRFjaVkhitBvZP0f+pZkXQ+61FhK9rVqiSxunXTA72R1+c4bibKyZYrl1LNa5lYA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:05.8538 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 601d107a-acd3-4207-00a6-08d7f65d57a7 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2023 X-Spam-Status: No, score=-19.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_STOCKGEN, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" setcontext returns to the specified context via an indirect jump, so there should be a BTI j. In case of getcontext (and all other returns_twice functions) the compiler adds BTI j at the call site, but swapcontext is a normal c call that is currently not handled specially by the compiler. So we change swapcontext such that the saved context returns to a local address that has BTI j and then swapcontext returns to the caller via a normal RET. For this we save the original return address in the slot for x1 of the context because x1 need not be preserved by swapcontext but it is restored when the context saved by swapcontext is resumed. The alternative fix (which is done on x86) would make swapcontext special in the compiler so BTI j is emitted at call sites, on x86 there is an indirect_return attribute for this, on AArch64 we would have to use returns_twice. It was decided against because such fix may need user code updates: the attribute has to be added when swapcontext is called via a function pointer and it breaks always_inline functions with swapcontext. Reviewed-by: Adhemerval Zanella --- sysdeps/unix/sysv/linux/aarch64/swapcontext.S | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S index d30c543e6f..b60cf04c92 100644 --- a/sysdeps/unix/sysv/linux/aarch64/swapcontext.S +++ b/sysdeps/unix/sysv/linux/aarch64/swapcontext.S @@ -28,8 +28,12 @@ .text ENTRY(__swapcontext) DELOUSE (0) - /* Set the value returned when swapcontext() returns in this context. */ - str xzr, [x0, oX0 + 0 * SZREG] + /* Set the value returned when swapcontext() returns in this context. + And set up x1 to become the return address of the caller, so we + can return there with a normal RET instead of an indirect jump. */ + stp xzr, x30, [x0, oX0 + 0 * SZREG] + /* Arrange the oucp context to return to 2f. */ + adr x30, 2f stp x18, x19, [x0, oX0 + 18 * SZREG] stp x20, x21, [x0, oX0 + 20 * SZREG] @@ -97,5 +101,12 @@ ENTRY(__swapcontext) 1: b C_SYMBOL_NAME(__syscall_error) +2: + /* The oucp context is restored here via an indirect branch, + x1 must be restored too which has the real return address. */ + BTI_J + mov x30, x1 + RET PSEUDO_END (__swapcontext) weak_alias (__swapcontext, swapcontext) +END_FILE From patchwork Tue May 12 10:14:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38960 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 48D6D395441B; Tue, 12 May 2020 10:15:13 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30082.outbound.protection.outlook.com [40.107.3.82]) by sourceware.org (Postfix) with ESMTPS id E553D3947C3A for ; Tue, 12 May 2020 10:15:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E553D3947C3A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=xO+GjftqZsZae5+TyfKkB+AZBpc/CdAj9KfbqhuP/s8=; b=1ujMe9dEIcdAPAIKrZJi16dairW0GaJ5P8q8LiboE+HcQfLLV5VHb+Dj9n1i7AUnLwdc7/14e6lHAiBICqart6sYBvDdlmCfBXvUr+TXPpCkCtmR0PFnuXPLpDSbi/6npubQB4ZQe0t/Uaj793EtJVQOxiRgAl2J35+a/f6QzU0= Received: from AM0PR03CA0030.eurprd03.prod.outlook.com (2603:10a6:208:14::43) by AM4PR0802MB2259.eurprd08.prod.outlook.com (2603:10a6:200:5e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.33; Tue, 12 May 2020 10:15:07 +0000 Received: from AM5EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:14:cafe::28) by AM0PR03CA0030.outlook.office365.com (2603:10a6:208:14::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28 via Frontend Transport; Tue, 12 May 2020 10:15:07 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT064.mail.protection.outlook.com (10.152.17.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:06 +0000 Received: ("Tessian outbound e88319d7ccd0:v54"); Tue, 12 May 2020 10:15:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 917fd2659f76cd7e X-CR-MTA-TID: 64aa7808 Received: from f87fe47b74a4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0B0A43E1-D9D7-44EF-A6F5-45D47C57A755.1; Tue, 12 May 2020 10:15:01 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f87fe47b74a4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:15:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HkRYe9yYqU7vbHqQx6wVSGT6g0LQy2Ra8SX9PKaUr1QHdy+j9WOgfckoYKNHx2ufwVWIw3dPRHvu2PZTRZl+n4CSdmkKHKbOzG5Q2fD/fnIC66DwRoVDWVbx+pMXOlg33fhnb7AnOyaE9k3LPLIXtNIa/rTJ9Ggn9YGPiMR6s+0B9rnqYJnnB83ODWQOck8ao+TDxDF8dVy3rMgyXkb1HXV9pF4yvhujxhtmXObCpyJpyH516olCRm176n34Nt7lgZg16HgoN3/BbNJYdNs4DtV1Ess/0Bu4CLteYwgfqytHPWoThEmJYvHEzMiBBe71MIQD6Q7BPXCQTDLsIQj5xA== 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-SenderADCheck; bh=xO+GjftqZsZae5+TyfKkB+AZBpc/CdAj9KfbqhuP/s8=; b=V1RjozlBMijuZPjLOyDs+/O8Kx4z3HS4FuPbZtOtJkPVbK67lItHdLaegWX6nsLLwZaqQLSyslUdxD2NbX1zbu5Y2F8x4u7wwNbI0XvKMr5IXJzcjjIQJY1Qg0PeH8tkIdRixUXvtVoYqn7DpPR2+yiK9j56R8Y0he740c2/RUpWi+h107dPl7IC/Ql+seBANK5aYjPnufdyH4cesTdiiekQ9xhBozD/wtYB5tDdlAT3A9vdCktIs6zdhyehRG5LJdR8hIcvBeJhfRWE3XDUKS49isEgoc8ZLrGrgL95Lg6rjbqZ4gFs1g0ThvoR8us/zS90VmQnHR7tx/35++xhxA== 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=xO+GjftqZsZae5+TyfKkB+AZBpc/CdAj9KfbqhuP/s8=; b=1ujMe9dEIcdAPAIKrZJi16dairW0GaJ5P8q8LiboE+HcQfLLV5VHb+Dj9n1i7AUnLwdc7/14e6lHAiBICqart6sYBvDdlmCfBXvUr+TXPpCkCtmR0PFnuXPLpDSbi/6npubQB4ZQe0t/Uaj793EtJVQOxiRgAl2J35+a/f6QzU0= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB3703.eurprd08.prod.outlook.com (2603:10a6:20b:83::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.33; Tue, 12 May 2020 10:14:59 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:14:59 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 08/13] aarch64: fix RTLD_START for BTI Date: Tue, 12 May 2020 11:14:44 +0100 Message-Id: <3b7c87b1784c8b610686c1dd9bc881a60ffaa788.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:14:59 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f9a1ebcc-b5bf-4342-a862-08d7f65d5832 X-MS-TrafficTypeDiagnostic: AM6PR08MB3703:|AM4PR0802MB2259: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: sHuZhcCy5QbyU5hu0HImIkhMT/lLqcXd9fq1T9p5KzbJ29VQKNrpU7dZCUNnA7nPFNtxvny0WI1pGfDdOuEusRJc0gDVDcAE3SQ+FaYDXCIrJx8vdc+WNBsGwDPMbRZBw0z6/czyWI8eXPsf/GlwshqquLyP/kE2Rv+raJubhuXHDDwb8afI2Q1VnlzvNpSbl0FIzSVyhRGZPLc5+7zYebKwPyXhy/z/nKS4a/vgo6FjyZSUE2sua/xy4/QuCUkLbq//7rtNasGdpkryNagY0HWJEc0AfuyvkTV9BzIIAmwd01hG4CY33oPporw69HugTKcdXJB7Exe1GjcJ/hyT7B8nT/EEPvQs9/Ed1CPsmid1euySZCuZi7kXcJ03eVK23ka3xFaDhAI+tuhI28M1Ubk9MOcJskIN5ySaB5u40mmWqpyV8JwUKShWYpSoR1MrePFvOTDtPIVS85y2+J0iqyd9MVZ4EzV6+6y0jYWiStCLISrqXdoj8QY3y4dLyPU0tU643ZqeFtJwZkdjq3X+zo888oH4EfPcF5ZA9TqAB2CiSHUsDRvFSNIiqg1y8ddhkqOTKmCfN+Z+u9j7PuOj77ukpcU97mcGIKrBIhmhq/4= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(396003)(346002)(39860400002)(136003)(366004)(33430700001)(33440700001)(8676002)(8936002)(478600001)(6512007)(6486002)(186003)(26005)(36756003)(2906002)(16526019)(69590400007)(52116002)(44832011)(6666004)(2616005)(5660300002)(6506007)(6916009)(316002)(956004)(66476007)(66556008)(66946007)(86362001)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: N+3b7wm5cUBz7X9iXvnhjRPljA80Wpuk0CDtt5ozshCixYdPbJnF82JSidFZqIv43uQ/qEU6E0V9Dj3nnGGaAOIVQdQGxonJheiNoJ5l3O9hp4cAqZ4tT0LGWEv1mhFq303dt0SmUPWF6rRRvRBJVeAURO5BcDVZm4r8bjM6PWXZ234YNcBdu9naKqTPsgnswrkO3/jRM6Iy5wnFO1vgKTiDwoe1HcspbvIFvm6lU9jFHwyEjt3+vUNpZX5gw4PUygmHGIJ7kdQLeHF6bGNtci7ST28Dt/cGFCr0M+1j8kOrYXAtswljRkQb/iZ9P+Q3AMieeSJVHVdVfsrHmhwP7mw+zB9VVq8eDE+OkyYLHfmbbd5dyCEEwg+vkb22+aamhLbgfYi8Ny1wzmCe+Zh5Ilp+B2gBmWs0ox0iFctA8Pxx6FGyxnudJ/YYssFGcn6o1S2AAgNjHADsXZaGvrQ7Vb28CliBtw+kMiUAaR7mAw3y627iRM7326+8Anz5SGsa X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3703 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT064.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(136003)(39860400002)(396003)(376002)(346002)(46966005)(33430700001)(6916009)(8676002)(70586007)(33440700001)(6666004)(5660300002)(478600001)(316002)(36906005)(356005)(70206006)(8936002)(82310400002)(2906002)(44832011)(86362001)(36756003)(6506007)(69590400007)(16526019)(336012)(26005)(956004)(6486002)(82740400003)(47076004)(186003)(2616005)(6512007)(81166007)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 4fb829f8-ff97-487c-7901-08d7f65d5391 X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gMFjdM71GVZ47ng+9w4CvmGRO8fGrnmsfDLXn+7hh81q4HYEx+Pva6cSpHCN/zkJ9lQtTH6AKTcUVhshxdp0KRtXLKYaNjbSmbppaO9dZ5lsr0WUxN8TkF0K7XJk9BCBnZEVg2AZN8j/ss6pG8sy0/mFuVInQKE1AUV3yUO6cotrAiJEI8LgHs2mQ0iUf0xWueJd65M5qEe7fVKbt1yfAeUPoLBaR66SHX47Jwfax6NieCs9JPuPg/PyWsIF/JFgPoqtTWBuJCJwi9TZPxJiA7MDzv3gc9xyXBAhCmTlOj1XbXCnv981H03DCSbJyMF+aK3XXnF4YR0IrHV+ADW1id9gj0o7THxyHFQJ2QjbzhzLdrmcbqAKbNnFHYJlXDOWTBdH7sPmfI7yCvMpWQDjoYhLd2PTelUvhXbpsKPSrnEmAuiLMNweMLkiQRXsl4MM4ApTnvAm7aYe/ffkRoiZp4pgLwe6bwNjSgWP1qzFImz+MCfg/US2/u9MTS5SA+aYeAzRgGu1cJpctERPplL71JOAmstQxkm8MfZK+VVZZw79/ucmYufMcOkNXwpCg9Gzdk+i+vVCUpCTAvek9x5fNy9J5BPqS2s1dXGLXdRTpgYr9TmK67+eC7Tt3lkXznkoMDGoI1iNWYBM33TMo2z8GA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:06.7651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f9a1ebcc-b5bf-4342-a862-08d7f65d5832 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2259 X-Spam-Status: No, score=-20.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Tailcalls must use x16 or x17 for the indirect branch instruction to be compatible with code that uses BTI c at function entries. (Other forms of indirect branches can only land on BTI j.) Also added a BTI c at the ELF entry point of rtld, this is not strictly necessary since the kernel does not use indirect branch to get there, but it seems safest once building glibc itself with BTI is supported. Reviewed-by: Adhemerval Zanella --- sysdeps/aarch64/dl-machine.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index db3335e5ad..70b9ed3925 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -125,6 +125,8 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) .globl _dl_start_user \n\ .type _dl_start_user, %function \n\ _start: \n\ + // bti c \n\ + hint 34 \n\ mov " PTR "0, " PTR_SP " \n\ bl _dl_start \n\ // returns user entry point in x0 \n\ @@ -178,7 +180,8 @@ _dl_start_user: \n\ adrp x0, _dl_fini \n\ add " PTR "0, " PTR "0, #:lo12:_dl_fini \n\ // jump to the user_s entry point \n\ - br x21 \n\ + mov x16, x21 \n\ + br x16 \n\ "); #define elf_machine_type_class(type) \ From patchwork Tue May 12 10:14:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38959 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 858E93947C3A; Tue, 12 May 2020 10:15:11 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80050.outbound.protection.outlook.com [40.107.8.50]) by sourceware.org (Postfix) with ESMTPS id AC4F83947C24 for ; Tue, 12 May 2020 10:15:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AC4F83947C24 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=XgSY/Mdvg3HJDCXKipO9ku0Wub2NZL6N/fpKUUBuS6o=; b=5rwzpV2FcJeYIomveYJ/HHLJ6tG1eCkBsp9h5vsFgJBtI4oXCsTeNleAUUftMm3X4BA0B7Z02nULWOtwTO+gT/XKG3YQcZ5az6lI7CoeH2gF2Xgvhh1x3JkkIsvAosmOOViufm3tjMwRESOxWA417CJJ6rN/1DXhRXSdQqgSA1U= Received: from DB7PR05CA0034.eurprd05.prod.outlook.com (2603:10a6:10:36::47) by DB6PR0801MB1960.eurprd08.prod.outlook.com (2603:10a6:4:76::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.33; Tue, 12 May 2020 10:15:06 +0000 Received: from DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:36:cafe::61) by DB7PR05CA0034.outlook.office365.com (2603:10a6:10:36::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.30 via Frontend Transport; Tue, 12 May 2020 10:15:06 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT022.mail.protection.outlook.com (10.152.20.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:06 +0000 Received: ("Tessian outbound 4cdf5642225a:v54"); Tue, 12 May 2020 10:15:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f343b6c64c79d204 X-CR-MTA-TID: 64aa7808 Received: from 7a475ea2a836.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4C3F4020-03C6-4DF0-AADD-E99F593BCE6F.1; Tue, 12 May 2020 10:15:01 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7a475ea2a836.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:15:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bE9l1hu9jwHJTFppEBpCjL/YpVUGQqu3XrOaiRthpAkkHtVMp+sEYsPrArh4E3R/VuQ57/fyP4hzFBlzrZ2SoFouR4xLn4XW7uVJTjjKXVrvg6xEqfByr7OwYvdtz7IluS1GlXxlrnoF9+sF+/krfHFt732u+fsV+gZgZ7LJ1XT2x7RJunktHG1+vZnCIGGZAIJXqU2k4T7rK7JJyXbKk/hxfbjFUDa9sH+gW7xA0u5yxLZn6oNrYgZyyoKIcdOcvOrCmfU9fEnnjHuvkJtRMW8gTEhRzql1sugWh0sQjgNGo0V+W1PtThdLaAHpBxXehG9gGw9X4EJB654fY76dug== 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-SenderADCheck; bh=XgSY/Mdvg3HJDCXKipO9ku0Wub2NZL6N/fpKUUBuS6o=; b=cq8E2kY/yWkyUt/5+vu1zVyrnBz6v8mzI9VtZh9TpnsDpSIDAlnceVqt9h8DiZanslg34xcxMb4FFV2/HEUPA762CWuWPAxNDo1NFIGKbyS3q4GJ/Zgs8GhafhjUQqm9x9hXUTL0xW5ZFtTeqKIJRW5RXy5sZ8Pd1+J2nHGwGkG4+FGLlh70nyuHoZFgBbA7gXbIQuHFgcTPhGSpVvu6FT/3q/OjtsKNlAHOtVW9HWTXhtIV7xgUe3NPZAXf3TFXZhi6rfVoM9muBBL6BeYVKOKTHjJJjf5nG0sj5Honb7yuNFm32wr3cJWh40WKlPgA4kW1gu86HXjwBNFhxGKpZQ== 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=XgSY/Mdvg3HJDCXKipO9ku0Wub2NZL6N/fpKUUBuS6o=; b=5rwzpV2FcJeYIomveYJ/HHLJ6tG1eCkBsp9h5vsFgJBtI4oXCsTeNleAUUftMm3X4BA0B7Z02nULWOtwTO+gT/XKG3YQcZ5az6lI7CoeH2gF2Xgvhh1x3JkkIsvAosmOOViufm3tjMwRESOxWA417CJJ6rN/1DXhRXSdQqgSA1U= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:15:00 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:15:00 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 09/13] aarch64: fix syscalls for BTI Date: Tue, 12 May 2020 11:14:45 +0100 Message-Id: <71ddb49c566feb4a5ebd96b421cf41f9f7954815.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:14:59 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3551a03d-f7a3-46b6-3e26-08d7f65d5835 X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|DB6PR0801MB1960: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7691;OLM:7691; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 6DfuYSA6hl2suUZQOD55KyS9EfRsu1Qywx1dEW26NdLetUGs+I5VT5k6XGvtJ1wK3XJmzCizqxO7T4wJui3CaV72a2tN0o2P+8BiVu8Kk3De71O2nkQQta4fPjeDFYkX/rqdZ+HEaogEcRCsWsm8MArMabUOynMuBt93AJU00/VdRVSPF9wBM+0OJ+v1yjN9zPwyhnmLr0UIzDmf2Uz9PJsoVn38LTMqFfIWJtiDa782BT8qhNwbqI9XOvJGHpXGGhEfMsISN0uI7ri9mJKmlsHV2b/n2vlmCaEy8bYLBtt3KOd9KDvd53DurNI8EVdB7/ZjipAuC7Tc2YTFbHoWlaoeNLyJYS8yTejhjKdPEt/SsqqTASyKEx/8EOla2nW2OOnMqg6rxOcQE1kr9h6Fae1CN1W7EzYE4He92RQqjCYH+2zpFoNQz/7A2s1wKXb5ExlQXivKKMLaU2yhEOkqC3lW9MMqHBI2JYT4UUy3x18tEKx6q0tadadkV9wWC7aNkKXaU9lEAtyF7cY9L5pVva/Mi27K3zLLPFa9BxVEbEuLHQS2HY5qb9PlQ8qWXns0RD/9cl7UA2qhLXyzsJKtWDF4UaZIbSGQzYkj659Cqf5GQErpeupafYcVe2M10UxGqP5iTWSIbMY39KSs2xTwcwx8GVsmUC4B9T7fPB+sDHa6J8omdCVAlv9/iRtth6+Q X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(36756003)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(33440700001)(6666004)(478600001)(6506007)(6512007)(8936002)(26005)(136400200001)(2004002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cKS/Kk2Fvgn8xlftFhrnc8b7m2hoDrQwrVmwN4GwC+6bqlVjGrt1ry3NirT4MCUCnF/9g2q+Npxk5aKdRm54BKOBfy8QmmH+aTwNWDOsUBG8Pfm4Gic2yyhIeH+GkSh8JTZRGOrUtc0pRo20jSmYb5n78gM5BiDGzo8vECR6xgNGqkAEgZArUcJSt+DIYaUb4fhJBIpRs1plOXEAfo9roN54UpixXhTDK/yBIrDQ5xttXBACH00VndGp8/a7XaiSB8NRPp4riNFuhGt8mgZ0xi09swWItMgytgyCUEQT5/JvPUUxjyfVf00KhKYpgtbrpgR10doW7/1nJHN6rTUgOTGqBgMQRtdG7Y7Oe7ivwyG6J+ZJA+sXCaJOzZAv0dNaBshyri11fzSSZK1TcovhuyTgzFk111LRbJzXYk+wpTACWFU6n3iiV/5M4c9JWSqZGwFR6R0ct2PyuacY5SpllhAYXPBLrTbWt4iMiaLOFPok/eRcbV3IWJOCwDteXZ2d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(136003)(396003)(346002)(376002)(39860400002)(46966005)(33430700001)(70206006)(186003)(336012)(33440700001)(47076004)(6512007)(82310400002)(2906002)(36756003)(6486002)(86362001)(8676002)(70586007)(69590400007)(5660300002)(8936002)(16526019)(26005)(6666004)(6506007)(81166007)(956004)(82740400003)(356005)(316002)(6916009)(2616005)(44832011)(478600001)(2004002)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 21889dca-4118-43a7-97a0-08d7f65d53c9 X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F8S3L0ooU6e4tifR4CDmGlPAyDBe/pNe96V/IG1HKWBmiSdOsCi+Bz1wJD+4/h7yO868Yk+AkGxANLZuYDns25uXEB0VDvhMOk3fU38kCsKOSZwRI+Kq8I6CQskfQqgTN+bKPbPSSBdJyUArhO7JHMXtNrg7mE7XUG25C9TF8zvhTc8P2jgEjSNwO0MHje1kN4HjVKJDs+lLrGWQiQKKDXjbziivYD9gxc7HutnwW3beK16jd9PAW/PMBkWJCvPsl1TPSIxbcvJVBTzaFNuy3hQrb8gIEV/lcVsA2uViPn9po0cSOz6ZUmSneTkc6Ag91WeH0V/UIFZqbfmm4/XCmtClPA2UU9a3ahTiBSKbFJ3qQLr/1HQKzT1gFzfn48fRE2xy6jjCnuTX9YmCZC+mlrgUE0pgLDRcwMOuOW58EU9fvZIEt5AJllCcmhBFDVgnkMwboLGDeLy8+32r2C9m6V3HSBg3iLzJMNySdh7E5PGjaktIUpLnme58NbeFwS1Od8hihcC+PsG71ehGteZ2aOg23GobFXRdr/cNZ2jqroA0cw3//t3Yw0XmLYHtnuo8aw0VRc9GZlweUIJT1udEkJzo3kT8JDAN1Uzznq0giLUNeMvaW+eNOGUMD6P9VBe8zcVMe/zi8YNYx83Bf5MgqswwYrNjODbijjhP+o4pNdwXzdAczUhXQYdRXov0n4NCNy+eKaWpTnuwuOKs/H0Nt8aUASV6oZPiLj8/xzieVVDRAXCPSPk4dmC/+yvKQT5k X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:06.8420 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3551a03d-f7a3-46b6-3e26-08d7f65d5835 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1960 X-Spam-Status: No, score=-20.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Syscall asm code needs an ELF property marking for BTI when glibc is built with BTI support so we add AArch64 variants of syscall-template.S. --- .../sysv/linux/aarch64/syscall-template.S | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/aarch64/syscall-template.S diff --git a/sysdeps/unix/sysv/linux/aarch64/syscall-template.S b/sysdeps/unix/sysv/linux/aarch64/syscall-template.S new file mode 100644 index 0000000000..50db585289 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/syscall-template.S @@ -0,0 +1,20 @@ +/* Assembly code template for system call stubs. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +END_FILE From patchwork Tue May 12 10:14:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38968 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 44DE33959C1C; Tue, 12 May 2020 10:15:17 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130040.outbound.protection.outlook.com [40.107.13.40]) by sourceware.org (Postfix) with ESMTPS id 25A003954419 for ; Tue, 12 May 2020 10:15:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 25A003954419 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=wkOCO3okZOYWcUs84DjHRQr2Z2oDBDqGGVP1vtin/40=; b=PSZeiePuc4OeBPzsCeBamv0H6ceFtKECViDnmOY8viVItelj7NOJvCtSBfPbFqhegPRc2Wk21W9QZi/b9p6sG2evRBhmrUpG/lGh3jPU7GgX+tM38/gX1nsP9zzUGa+Y4fPTTcSFFEvr6D+Yd4kDezrUVNbLv6wUySBuuP3yvRI= Received: from AM6PR10CA0016.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::29) by DB6PR0802MB2213.eurprd08.prod.outlook.com (2603:10a6:4:84::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 10:15:09 +0000 Received: from AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:89:cafe::78) by AM6PR10CA0016.outlook.office365.com (2603:10a6:209:89::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28 via Frontend Transport; Tue, 12 May 2020 10:15:09 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT054.mail.protection.outlook.com (10.152.16.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:08 +0000 Received: ("Tessian outbound 11763d234d54:v54"); Tue, 12 May 2020 10:15:08 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5a6f34f1dd84f0b5 X-CR-MTA-TID: 64aa7808 Received: from 9c0e19bae1bc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F1FDAE2C-B95C-464C-8988-F3D36A4BAC51.1; Tue, 12 May 2020 10:15:02 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9c0e19bae1bc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:15:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OXnUrao5HCFnbkhbTFcVvAPcYYR5iB0tfijQ4XrFxWVB7GitKr1txjD04FT4vCcLS8WVMmlUq8RcvZXWnbmM2RQsbXirx38qazJIYizrcSGG9v8TfqMs7byG9wGQRrj7FPQKfoZZL8S3hsfbXvdLlVYlx/GQ+H9s8K3BNXq/l69Uar9BkRloWvhJIQBL6+hq1HRFNodwIy84FJb66A2yg7dHbPonfilycMqFZNYrbEHwYx5OLlWGgn49jxUAphBffpa9R/N5WOZpp0KlOevHAWHFe3xsARclWl1HGr1iowL8qMdGE2BFLEBaArTwOnnsH2fvwvxgVhCkeR77iGoQag== 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-SenderADCheck; bh=wkOCO3okZOYWcUs84DjHRQr2Z2oDBDqGGVP1vtin/40=; b=PkpftMwdCOEpadnXd8HqfLhHC1in5zw8eLZ9q7CTF9Qh/paDO9/RTOtAzQQDxq8Rwur1dhY5hKCk0/dWLVUBiapojG6yRpbvWr4wfLPt/HJm2TMNhIyIG9CfOGlwT6AOS6PwdilnWDlfwT0Wn1uxO+Ex97PImoYCFyNCdEu+hCZUUn8UhHQ80vpkKN19zScQmCEMz3dKZ+fBg2780bXowsmFNQF6uFIpYCxCbQJclHiiXtb5/nor8sGHHgfQU3VMqHrq1mpSs1wgeyrfUXDTdmgW1n+EhDnx9DCLzF2Rp7e+CFE4+nBM0L0TjxhojPPC/HEwZ1nGTSouyuEqOV/H+Q== 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=wkOCO3okZOYWcUs84DjHRQr2Z2oDBDqGGVP1vtin/40=; b=PSZeiePuc4OeBPzsCeBamv0H6ceFtKECViDnmOY8viVItelj7NOJvCtSBfPbFqhegPRc2Wk21W9QZi/b9p6sG2evRBhmrUpG/lGh3jPU7GgX+tM38/gX1nsP9zzUGa+Y4fPTTcSFFEvr6D+Yd4kDezrUVNbLv6wUySBuuP3yvRI= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:15:01 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:15:00 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 10/13] aarch64: enable BTI at runtime Date: Tue, 12 May 2020 11:14:46 +0100 Message-Id: <029cbad4ed1c9338b87766fc8cd90ea7ef1401f7.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:14:59 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d6212c7a-b3b3-45ca-47ce-08d7f65d594b X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|AM6PR08MB2982:|DB6PR0802MB2213: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GO9jV2pLWY7WUx/VMzvVqoPk3As/itO5RO+/AKV/e/devnl3ZqUmX5GPD2a3yjyPa65q3HK6CdBhy11NGDWLxK3c7eVDG01YhK7g26iVEGhV+kb3iH41MUmIwruXTyGOiUmDMk21UFgYCmYGmg/UZuUUmmKgEhF4+a1G+3i5NRdi3L0fcVngRzpOffEkbcU53kzA+1BxlNdUl5zLlkqghWHwuVAHLHXkhOAXU+KsIb+o3ivcdNYlB6Qs2csU7LUE01m7CJm9y808nNNMtpSc+Q/6whVp5bBqAik+yzvluG4uwSBRiOd77SDK6w+3X6V+2hbiZ2y5tJ4KJUjroLAsFvUWTUkgbhqlpmL7tnNktGqYObMUXzRCwGOb0budAZv2ZUEfzSQImYJRPr7HvGdLVDhwncbVLUYLeejgIWfaqPjxB/8Mp+1UOS12/jVKPV+oXWsTxl970zuI8Wj7OCl9kIdGUhuM2IsmDXBy+Hk2r7Nqsms4e70QMzbL7OfEkMYXqVCJ4M2/pZLh593MUy7Ig0lHIDVnfIUy0hkMK33rP69yIMdGv99n4UBtqgR9psmvvlhxgzj2kYJHu5pn8oW0MMezVKh20wtwIkmooc/1YWyOG0apftG+SYBb0U3RVlx2cbdCcndTmVjk6rvV3rhtpnmo31GDQkokUNnGqQoYCwm2laqFJU+SJdcb3MMY8lyG X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(30864003)(36756003)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(4326008)(33440700001)(6666004)(478600001)(6506007)(6512007)(8936002)(26005)(136400200001)(2004002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: pDusXzJUL4O14u1OEu3+W+6g1Wyjeca8L7wPGRcL9T9bHcSYjBEkThfgXMIXXM70/yHcup+58p7cz2ZkxBqli3Sy4tDsf7fiH42Xeb+mvD2MmSbOyjVO+s2P2uAa0NMJpNbifwBBjxy0CFWcxPPa0GVPAeEnemnVjf5HeQYBu21e2onJJeIFsKp1IfJ04scFuaV6O5e2lpVA9RdA30qydYHjeH0fuklAiv6/t1uOXFJzXKWfXmMGeZCLwtyaQHddYaL2cJRCLYjeyKtV5JoT9H2Qc8xZM1BSkDvC5J0nKQ8N05hF6ChXKMf7/TXWcLWo2EC9r4o3wo+ITQQIHfLxOjJm1yv0M5sd1JTUl0CrW7sw+uNd4UFham+3N+xRuW5Zos7q4tfk7C/lzOWcYB1sNuyT++Y+GoMa1IJJdrmQe1EJ1B9z1dPOdBuuWDbFeNi7qXDmEerIEFfTemIg39v4sm88jKzDoNv2qe/THvSRQ60= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(346002)(39860400002)(136003)(396003)(376002)(46966005)(33430700001)(26005)(47076004)(30864003)(36756003)(82740400003)(5660300002)(8676002)(69590400007)(336012)(2906002)(6916009)(956004)(356005)(478600001)(70206006)(8936002)(6666004)(316002)(4326008)(36906005)(33440700001)(82310400002)(86362001)(70586007)(6506007)(186003)(81166007)(6486002)(2616005)(44832011)(16526019)(6512007)(136400200001)(2004002); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: eaba334d-3cec-41f8-b1c7-08d7f65d5403 X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oUUb5kMSw4cW9MsdoBcOc7Vj2HXAdFOkGmnF9Na7kayje5kwGXgMX8y0Wjb4ycU2bwPQiaY1N1fKYkBo8iS8GwHDMFfB71Jqsb3vF2gY3grtV5Q+iiTBNAQnvcl9wDMUsVQDjLUwv5kBtL52A1mLYpWnH2lNfqeAovFKUpXV1grGParPyWcCWQEgZLpd4RW0Ztq2ZDC5xTVOnYfMcGXWwq+yZdasfaCDblBBis2CN6ibNMxc7dI+Fq7f4I2H6iMPHrrHUMpXJQRhx70jms3eIqSDTMOwFtUvfzQicPGmjg3WLd79t5TxKkBJydiVYgx58wnsWFbNczn6DiND0OIUDKlSQugcdyi579Coi4Xu+ywirViPxlilQEzhaHJPd2aZk9CU47Gkorb2bYPujSRYzcUtDL9uMhKGQBy8CRhEAdeMY5EUZ4JgNHYGRGQmTtEZbMyvXqGC6dVLCndxCisBASEvZJ1bfjh6/DqK1JlV/V9qwS7m0SgEdGGZi//hW5hXmfwm1QWPl0rqAOLuyCqar2aPA/obnpfBzPqXzac3djAm9nObPI4S8tvwTIsbBoHvJSPL4yJzzXfwsJnFeT6VsU3z0Z9BbbK1hbGAC79qNZbsoQJG9oQKH2K5SxtZS/hAp9DN9uoRQ21JGbfuyQ9pEdUrtMh77ylmeSO1Qr2e4KdSjaoGr+frtW5iJsP+EneNuzhdkuJ81wIU6aRypO8RPNEeHdVmV+61n8DGr7R6AWovhb/Pb48mZcZbmL4kzlrt X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:08.6002 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6212c7a-b3b3-45ca-47ce-08d7f65d594b 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2213 X-Spam-Status: No, score=-19.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Cc: Sudakshina Das Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" From: Sudakshina Das Binaries can opt-in to using BTI via an ELF object file marking. The dynamic linker has to then mprotect the executable segments with PROT_BTI. In case of static linked executables or in case of the dynamic linker itself, PROT_BTI protection is done by the operating system. On AArch64 glibc uses PT_GNU_PROPERTY instead of PT_NOTE to check the properties of a binary because PT_NOTE can be unreliable with old linkers (old linkers just append the notes of input objects together and add them to the output without checking them for consistency which means multiple incompatible GNU property notes can be present in PT_NOTE). Otherwise the AArch64 logic follows the x86 logic for handling GNU properties. BTI property is handled in the loader even if glibc is not built with BTI support, so in theory user code can be BTI protected independently of glibc. In practice though user binaries are not marked with the BTI property if glibc has no support because the static linked libc objects (crt files, libc_nonshared.a) are unmarked. This patch affects x86 because _dl_process_pt_note is now called with PT_GNU_PROPERTY notes too, not just PT_NOTE, but x86 only checks the first NT_GNU_PROPERTY_TYPE_0 so the behaviour is unchanged. This patch relies on Linux userspace API that is scheduled to be merged in Linux 5.8 and now it is in the for-next/bti-user branch of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git. Co-authored-by: Szabolcs Nagy TODO: - separate PT_NOTE and PT_GNU_PROPERTY handling. - share property handling code between x86 and aarch64. --- elf/dl-load.c | 2 + elf/rtld.c | 2 + sysdeps/aarch64/Makefile | 4 + sysdeps/aarch64/dl-bti.c | 54 ++++++ sysdeps/aarch64/dl-prop.h | 170 ++++++++++++++++++ sysdeps/aarch64/linkmap.h | 3 + sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h | 1 + sysdeps/unix/sysv/linux/aarch64/bits/mman.h | 31 ++++ .../unix/sysv/linux/aarch64/cpu-features.c | 3 + .../unix/sysv/linux/aarch64/cpu-features.h | 2 + 10 files changed, 272 insertions(+) create mode 100644 sysdeps/aarch64/dl-bti.c create mode 100644 sysdeps/aarch64/dl-prop.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/mman.h diff --git a/elf/dl-load.c b/elf/dl-load.c index 06f2ba7264..36c7b8d2bc 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -1146,6 +1146,8 @@ _dl_map_object_from_fd (const char *name, const char *origname, int fd, l->l_relro_size = ph->p_memsz; break; + case PT_GNU_PROPERTY: + /* Fall through. PT_GNU_PROPERTY holds property notes. */ case PT_NOTE: if (_dl_process_pt_note (l, ph, fd, fbp)) { diff --git a/elf/rtld.c b/elf/rtld.c index 5ccc3c2dbb..623b46b226 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -1506,6 +1506,8 @@ of this helper program; chances are you did not intend to run this program.\n\ main_map->l_relro_size = ph->p_memsz; break; + case PT_GNU_PROPERTY: + /* Fall through. PT_GNU_PROPERTY holds property notes. */ case PT_NOTE: if (_rtld_process_pt_note (main_map, ph)) _dl_error_printf ("\ diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile index 9cb141004d..5ae8b082b0 100644 --- a/sysdeps/aarch64/Makefile +++ b/sysdeps/aarch64/Makefile @@ -1,5 +1,9 @@ long-double-fcts = yes +ifeq ($(subdir),elf) +sysdep-dl-routines += dl-bti +endif + ifeq ($(subdir),elf) sysdep-dl-routines += tlsdesc dl-tlsdesc gen-as-const-headers += dl-link.sym diff --git a/sysdeps/aarch64/dl-bti.c b/sysdeps/aarch64/dl-bti.c new file mode 100644 index 0000000000..adb7ea9bcd --- /dev/null +++ b/sysdeps/aarch64/dl-bti.c @@ -0,0 +1,54 @@ +/* AArch64 BTI functions. + Copyright (C) 2020 Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include + +static int +enable_bti (struct link_map *map, const char *program) +{ + const ElfW(Phdr) *phdr; + unsigned prot = PROT_READ | PROT_EXEC | PROT_BTI; + + for (phdr = map->l_phdr; phdr < &map->l_phdr[map->l_phnum]; ++phdr) + if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_X)) + { + ElfW(Addr) start = phdr->p_vaddr + map->l_addr; + ElfW(Addr) len = phdr->p_memsz; + if (__mprotect ((void *) start, len, prot) < 0) + { + if (program) + _dl_fatal_printf ("%s: mprotect failed to turn on BTI\n", + map->l_name); + else + _dl_signal_error (EINVAL, map->l_name, "dlopen", + N_("mprotect failed to turn on BTI")); + } + } + return 0; +} + +/* Enable BTI for L if required. */ + +void +_dl_bti_check (struct link_map *l, const char *program) +{ + if (GLRO(dl_aarch64_cpu_features).bti && l->l_mach.bti_guarded) + enable_bti (l, program); +} diff --git a/sysdeps/aarch64/dl-prop.h b/sysdeps/aarch64/dl-prop.h new file mode 100644 index 0000000000..ee10882440 --- /dev/null +++ b/sysdeps/aarch64/dl-prop.h @@ -0,0 +1,170 @@ +/* Support for GNU properties. AArch64 version. + Copyright (C) 2018-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _DL_PROP_H +#define _DL_PROP_H + +#include + +extern void _dl_bti_check (struct link_map *, const char *) + attribute_hidden; + +static inline void __attribute__ ((always_inline)) +_rtld_main_check (struct link_map *m, const char *program) +{ + _dl_bti_check (m, program); +} + +static inline void __attribute__ ((always_inline)) +_dl_open_check (struct link_map *m) +{ + _dl_bti_check (m, NULL); +} + +static inline void __attribute__ ((unused)) +_dl_process_aarch64_property (struct link_map *l, + const ElfW(Nhdr) *note, + const ElfW(Addr) size, + const ElfW(Addr) align) +{ + /* The NT_GNU_PROPERTY_TYPE_0 note must be aligned to 4 bytes in + 32-bit objects and to 8 bytes in 64-bit objects. Skip notes + with incorrect alignment. */ + if (align != (__ELF_NATIVE_CLASS / 8)) + return; + + const ElfW(Addr) start = (ElfW(Addr)) note; + + unsigned int feature_1 = 0; + unsigned int last_type = 0; + + while ((ElfW(Addr)) (note + 1) - start < size) + { + /* Find the NT_GNU_PROPERTY_TYPE_0 note. */ + if (note->n_namesz == 4 + && note->n_type == NT_GNU_PROPERTY_TYPE_0 + && memcmp (note + 1, "GNU", 4) == 0) + { + /* Check for invalid property. */ + if (note->n_descsz < 8 + || (note->n_descsz % sizeof (ElfW(Addr))) != 0) + return; + + /* Start and end of property array. */ + unsigned char *ptr = (unsigned char *) (note + 1) + 4; + unsigned char *ptr_end = ptr + note->n_descsz; + + do + { + unsigned int type = *(unsigned int *) ptr; + unsigned int datasz = *(unsigned int *) (ptr + 4); + + /* Property type must be in ascending order. */ + if (type < last_type) + return; + + ptr += 8; + if ((ptr + datasz) > ptr_end) + return; + + last_type = type; + + if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) + { + /* The size of GNU_PROPERTY_AARCH64_FEATURE_1_AND is 4 + bytes. When seeing GNU_PROPERTY_AARCH64_FEATURE_1_AND, + we stop the search regardless if its size is correct + or not. There is no point to continue if this note + is ill-formed. */ + if (datasz != 4) + return; + + feature_1 = *(unsigned int *) ptr; + if ((feature_1 & GNU_PROPERTY_AARCH64_FEATURE_1_BTI)) + l->l_mach.bti_guarded = true; + + /* Stop if we found the property note. */ + return; + } + else if (type > GNU_PROPERTY_AARCH64_FEATURE_1_AND) + { + /* Stop since property type is in ascending order. */ + return; + } + + /* Check the next property item. */ + ptr += ALIGN_UP (datasz, sizeof (ElfW(Addr))); + } + while ((ptr_end - ptr) >= 8); + } + + /* NB: Note sections like .note.ABI-tag and .note.gnu.build-id are + aligned to 4 bytes in 64-bit ELF objects. */ + note = ((const void *) note + + ELF_NOTE_NEXT_OFFSET (note->n_namesz, note->n_descsz, + align)); + } +} + +#ifdef FILEBUF_SIZE +static inline int __attribute__ ((unused)) +_dl_process_pt_note (struct link_map *l, const ElfW(Phdr) *ph, + int fd, struct filebuf *fbp) +{ + if (ph->p_type != PT_GNU_PROPERTY) + return 0; + + const ElfW(Nhdr) *note; + ElfW(Nhdr) *note_malloced = NULL; + ElfW(Addr) size = ph->p_filesz; + + if (ph->p_offset + size <= (size_t) fbp->len) + note = (const void *) (fbp->buf + ph->p_offset); + else + { + if (size < __MAX_ALLOCA_CUTOFF) + note = alloca (size); + else + note = note_malloced = malloc (size); + if (note == NULL) + return -1; + if (__pread64_nocancel (fd, (void *) note, size, ph->p_offset) != size) + { + if (note_malloced) + free (note_malloced); + return -1; + } + } + _dl_process_aarch64_property (l, note, ph->p_filesz, ph->p_align); + if (note_malloced) + free (note_malloced); + return 0; +} +#endif + +static inline int __attribute__ ((unused)) +_rtld_process_pt_note (struct link_map *l, const ElfW(Phdr) *ph) +{ + if (ph->p_type != PT_GNU_PROPERTY) + return 0; + const ElfW(Nhdr) *note = (const void *) (ph->p_vaddr + l->l_addr); + _dl_process_aarch64_property (l, note, ph->p_memsz, ph->p_align); + return 0; +} + +#endif /* _DL_PROP_H */ diff --git a/sysdeps/aarch64/linkmap.h b/sysdeps/aarch64/linkmap.h index 943a9ee9e4..4b9be4202f 100644 --- a/sysdeps/aarch64/linkmap.h +++ b/sysdeps/aarch64/linkmap.h @@ -16,8 +16,11 @@ License along with the GNU C Library; if not, see . */ +#include + struct link_map_machine { ElfW(Addr) plt; /* Address of .plt */ void *tlsdesc_table; /* Address of TLS descriptor hash table. */ + bool bti_guarded; /* Branch Target Identification mechanism enabled. */ }; diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h index 4ee14b4208..af90d8a626 100644 --- a/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h +++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h @@ -72,3 +72,4 @@ #define HWCAP2_BF16 (1 << 14) #define HWCAP2_DGH (1 << 15) #define HWCAP2_RNG (1 << 16) +#define HWCAP2_BTI (1 << 17) diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/mman.h b/sysdeps/unix/sysv/linux/aarch64/bits/mman.h new file mode 100644 index 0000000000..ecae046344 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/bits/mman.h @@ -0,0 +1,31 @@ +/* Definitions for POSIX memory map interface. Linux/AArch64 version. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_MMAN_H +# error "Never use directly; include instead." +#endif + +/* AArch64 specific definitions, should be in sync with + arch/arm64/include/uapi/asm/mman.h. */ + +#define PROT_BTI 0x10 + +#include + +/* Include generic Linux declarations. */ +#include diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c index 896c588fee..0fc507058b 100644 --- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c +++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c @@ -83,4 +83,7 @@ init_cpu_features (struct cpu_features *cpu_features) if ((dczid & DCZID_DZP_MASK) == 0) cpu_features->zva_size = 4 << (dczid & DCZID_BS_MASK); + + /* Check if BTI is enabled. */ + cpu_features->bti = GLRO (dl_hwcap2) & HWCAP2_BTI; } diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h index 1389cea1b3..a81f186ec2 100644 --- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h +++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h @@ -20,6 +20,7 @@ #define _CPU_FEATURES_AARCH64_H #include +#include #define MIDR_PARTNUM_SHIFT 4 #define MIDR_PARTNUM_MASK (0xfff << MIDR_PARTNUM_SHIFT) @@ -64,6 +65,7 @@ struct cpu_features { uint64_t midr_el1; unsigned zva_size; + bool bti; }; #endif /* _CPU_FEATURES_AARCH64_H */ From patchwork Tue May 12 10:14:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38967 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DBF013959C83; Tue, 12 May 2020 10:15:16 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150051.outbound.protection.outlook.com [40.107.15.51]) by sourceware.org (Postfix) with ESMTPS id 0F377394CC12 for ; Tue, 12 May 2020 10:15:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0F377394CC12 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=GKQoBgg4c3SHOriWg6bR8RhDgZ/V6mC7nVSg1lU4o3Y=; b=lKPma/Pb0rWdMXW1GA9EuZ5HYWCF+iXhVIGE/kw43fOljmsnTq9ywImr08UEQeAPxbzzSUtjJDf0daztZiu+BdfkAIwaoHEO+xpbbJspSnDO7tuZrR1pHx8CeSehJgtAHlOPa6tp+oJdNMZjd+MfGzWGAJ+lgjBt33DxAoFpADQ= Received: from AM7PR04CA0010.eurprd04.prod.outlook.com (2603:10a6:20b:110::20) by VE1PR08MB5133.eurprd08.prod.outlook.com (2603:10a6:803:109::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:15:09 +0000 Received: from AM5EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::1a) by AM7PR04CA0010.outlook.office365.com (2603:10a6:20b:110::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.29 via Frontend Transport; Tue, 12 May 2020 10:15:09 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT027.mail.protection.outlook.com (10.152.16.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:09 +0000 Received: ("Tessian outbound 567b75aed2b9:v54"); Tue, 12 May 2020 10:15:08 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b3424ef3191326d8 X-CR-MTA-TID: 64aa7808 Received: from a102e96403a2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5C901DC2-2486-4046-94EF-1F93BB8FEC92.1; Tue, 12 May 2020 10:15:03 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a102e96403a2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:15:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g3jO47LSmdfL1d9IXAkjOudE6NBhc6a0gBgaLNN7qczbcQngV/iq4LEmzwlLt4+KDVxVaw5L62JoG+F6LDEShIp3xQ0jImZ0zARXs90uWDzzzDsAPLuibco52ILEVR7SpUYa2+jODxm7gPfx0B+3T5qd/2Qjc5yZLJXri6nM/vkH+874qeLWzlq4XfDyVi72bxozuA22WafENEqa6CveNpF3qzZ5VJXYrMcyqB4wRAONVXpwqzbj7sQtWXwkqK1MnSH3tYpZhA+BnjbDx9wftZZjkcOrSYjuppYYSN/QOYLTZpf8Qeet3mirjrLhUA+hvlqb4pBcXMy3RXqOJ4bzLg== 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-SenderADCheck; bh=GKQoBgg4c3SHOriWg6bR8RhDgZ/V6mC7nVSg1lU4o3Y=; b=NQJe1YF2U/MVxxPkut2ZrFLYmf69nBhz3K+dNtlPfNm22LxXmQTK1lwwFXaE+ZcePK5eGn4Z0C1cJDWSSeRpreo22YZ6/S4BT/Y1uPm6Z0kzLvlC8h4ivmVey5WUTiQa/q7bbFgbLJPMOPKI7Ms/S7QSAw4KGD8X4FDh8R5IixRdLHAPoz9ZM2Lm05OUqP6k15rnFG3AZC4Kb4K4NkQzbs+dV5NnyH9dHDzxPhjA/aqu2ms6L28PUVGdTjgSgr+4l3e37aHfyQkXzP1x/qmXJmBtj0nZRFeeIfH3h11y5qX1XAjLCTD6z5ZaVUzvZWDCUYuefWYhxhlvXM7No1950w== 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=GKQoBgg4c3SHOriWg6bR8RhDgZ/V6mC7nVSg1lU4o3Y=; b=lKPma/Pb0rWdMXW1GA9EuZ5HYWCF+iXhVIGE/kw43fOljmsnTq9ywImr08UEQeAPxbzzSUtjJDf0daztZiu+BdfkAIwaoHEO+xpbbJspSnDO7tuZrR1pHx8CeSehJgtAHlOPa6tp+oJdNMZjd+MfGzWGAJ+lgjBt33DxAoFpADQ= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:15:01 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:15:01 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 11/13] aarch64: configure check for pac-ret code generation Date: Tue, 12 May 2020 11:14:47 +0100 Message-Id: <167fbfd1966e2a85823a4a6e8541bab0a3d6f6e1.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:00 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d7a19000-6ce2-40bc-6216-08d7f65d5987 X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|VE1PR08MB5133: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3276;OLM:3276; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: gWv1WifFppB0nNzqB7KlE7cHAjFZ6Npk15Owmb62I574tOs0QK3YDjlxEmCg8Hh2QqCrz63AHi2/JtB7dzifTle5HXAaBVAO8yqDClNhopzGpUO+tVF/mbeaK58nbTc9uEdje7kax4Ztw3akTVafEv5BJvkLtvh1aP1P0zKtogopGWPoRpc8O4P7+vPedj7KuDm/VJ8iIzwLvCo9rDgCQLo6LxvkAV59o2yIQ6DrVCHxoy8myShokoenZpe7rilcuEzX6fiyl2u+o+V/raIFiEMopH6nmEaQib2BgZbwUaqy1diAXLgzyvIfDl8itZry2ZOir6gpa3RpzzTootHTvRruIuwsu/k+ZDyvpIP6ronImK6VsFJeC+rbbyxRjnta4YoKv0+I+OvHQdOELQnU3GogLRz8cdPP8ndqnoDpaDWvTCuzZ95QpXal+U5HFFQ5m7o0j7nAMxUibTD6hXySAfqF+o4Hao8HVBulu+oxQKCtVAG8FQza7QY58ZYauxd74fMqxF+WmMpNAG3ZJRJwUbmZjcTfGVMbKz0/pZKemhgr8LTmnUfzr4ik4XpCh57USRcChHsUQyab2PnkEvKehistZUYpbEZyWJA/0zrUXpM= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(36756003)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(33440700001)(6666004)(478600001)(6506007)(6512007)(8936002)(26005)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: jgVneLZ0Spj522L5f2QL4DUMMbPNl+U9iYls8lfcbu6vo2tgZywRN726wghnKl3bZagAtqGgLVKwq+WzefdPOIGT8Y3UlaIvyhhg5RpXru2QoENCmLXXOuVxCCRqnUkTRn286XrAV13fW1r1kxfunNo73YvnBjcwAUjlaP2+aINcbrUlfphaKBnhut9P/T8nOEMYmj6IfHKIiALt0sh5jPPE6smRGxC8OmaSTOLC9fWhp+oWJdJflvW2Jz8GkKtbn33xn5F3oZvtL8BkBhE+hZNTrLfEznO1CBibot6poXgzmniOEt1dYSTmLBylYgLrEfwvw8eNRubXvGx02+ope1xCQayXWdj8SjyhK976S/AIzfld5+IoZEiZWeWAsB0LDymi9LqQo6nWbMWixfhA+3EM+nYEeQEwh3F0bHmnqWl0363diwb6B738RxKbHxj3L8xMiwneddle9/4rYtfqR+YK0X2wAeH9JGNBCoBgezs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT027.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(376002)(136003)(396003)(39860400002)(346002)(46966005)(33430700001)(36906005)(8936002)(2616005)(956004)(186003)(316002)(16526019)(336012)(6506007)(26005)(36756003)(44832011)(5660300002)(6666004)(8676002)(6486002)(70586007)(6916009)(69590400007)(70206006)(33440700001)(82310400002)(81166007)(6512007)(82740400003)(47076004)(478600001)(2906002)(356005)(86362001)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 580e867e-2fbf-4f91-4961-08d7f65d5443 X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2H78V9WvEobc5U8QRskwEwAZ3Csq5aAHFVtmj/gQZQZF5eG7+J7cUcnkt9UBZEIgCpdCVN96KfWsbjMGDjz5Y7xIFbV3nGrciWxcm1dz2CbO/BV541dvGsjMmIr9OTcKnzeroHTsH8hlleUc5UdoS6a/jdHu3rIv2w4jRjV2Xtou9Z7mqNz1qEh3SNmLMKE2SeFxGZ2xM5Wf8m/fSKEjkNHfxVn7VL4Taqyn9XOx9gVLXtASuvTs9DHFFdW7ZWJSVVZzyDNifN0KIl6E5F2YQeh7qfVuZXT/9I0fAP74FZhy/k9/okDXA4XNIgb8/JFzON60Fbwczv5HbXc5DjIgzw+2aVhKReXgDe52pi97+cA1zjzY0g6pbuBZEPqBrYb6kse/ivaHqaynS1IXh/vWImlYx2JZkm7zWtUsthJ7YyJ+23FwwZt1W4nPGVBsARkKIhXHVC/8Gsl307CHmL7vzGdaKBFCvIi+St9iDmZjAPi8OEL0+jeNlSJlRQ2Uq2IbrZWw924j3xCGQdyyvTrju60BawVtElSaPWXTTnJaD5As6r+I/I0ZGmOp+Kb3D8B4WkgzXmBsoACobcFpRnHIQioizp0AerUN7Yoa0XJCnBK0JQSi1OTGyphU4dVq7bGSdBMnV5HjPRPYRX8Y8WuXlQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:09.0000 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7a19000-6ce2-40bc-6216-08d7f65d5987 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5133 X-Spam-Status: No, score=-19.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Return address signing requires unwinder support, which is present in libgcc since >=gcc-7, however due to bugs the support may be broken in >confdefs.h fi + +# Check if glibc is built with return address signing, i.e. +# if -mbranch-protection=pac-ret is on. We need this because +# pac-ret relies on unwinder support so it's not safe to use +# it in assembly code unconditionally, but there is no +# feature test macro for it in gcc. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pac-ret is enabled" >&5 +$as_echo_n "checking if pac-ret is enabled... " >&6; } +if ${libc_cv_aarch64_pac_ret+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } \ + && { ac_try='grep -q -E '\''(hint( | )+25|paciasp)'\'' conftest.s' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + libc_cv_aarch64_pac_ret=yes + fi + rm -rf conftest.* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_pac_ret" >&5 +$as_echo "$libc_cv_aarch64_pac_ret" >&6; } +if test $libc_cv_aarch64_pac_ret = yes; then + $as_echo "#define HAVE_AARCH64_PAC_RET 1" >>confdefs.h + +fi diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac index 798f494740..8248ecf2ed 100644 --- a/sysdeps/aarch64/configure.ac +++ b/sysdeps/aarch64/configure.ac @@ -39,3 +39,24 @@ EOF if test $libc_cv_aarch64_bti = yes; then AC_DEFINE(HAVE_AARCH64_BTI) fi + +# Check if glibc is built with return address signing, i.e. +# if -mbranch-protection=pac-ret is on. We need this because +# pac-ret relies on unwinder support so it's not safe to use +# it in assembly code unconditionally, but there is no +# feature test macro for it in gcc. +AC_CACHE_CHECK([if pac-ret is enabled], [libc_cv_aarch64_pac_ret], [dnl + cat > conftest.c < X-Patchwork-Id: 38965 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F929393C8AC; Tue, 12 May 2020 10:15:15 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40076.outbound.protection.outlook.com [40.107.4.76]) by sourceware.org (Postfix) with ESMTPS id 72002395383D for ; Tue, 12 May 2020 10:15:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 72002395383D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=Q+9dftFW6tCilO5oddjucx4wzEQ19EYrlh6w6k3261c=; b=Mu/z9AnKJEmhc5WtXqtn1D1sVre0KRIELilKdjweZgkwJbJwMtcRD8iAeFe1dPIPIo5ACSVPHyOR39cFQuDyoVAtOvukCYiQ0XlpxupEHBKtEVRn2kSqkSy1EjCejARMmoS8ba9UNqjoJTwo6K4xTVL5b0VHyV29pro5cDqC8T0= Received: from AM0PR03CA0014.eurprd03.prod.outlook.com (2603:10a6:208:14::27) by AM7PR08MB5511.eurprd08.prod.outlook.com (2603:10a6:20b:10d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 10:15:09 +0000 Received: from AM5EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:14:cafe::e4) by AM0PR03CA0014.outlook.office365.com (2603:10a6:208:14::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28 via Frontend Transport; Tue, 12 May 2020 10:15:09 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT064.mail.protection.outlook.com (10.152.17.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:09 +0000 Received: ("Tessian outbound e88319d7ccd0:v54"); Tue, 12 May 2020 10:15:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c8fbb37af3f63bd5 X-CR-MTA-TID: 64aa7808 Received: from 2e6d7bcb9a12.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AE3EEA93-CA37-4476-A71C-D37647429C48.1; Tue, 12 May 2020 10:15:03 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2e6d7bcb9a12.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:15:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TC5rafnoRB2cErm7pwH1EBtNMEi1KmPEOnUc+kyC74Sj/2RXqSvD5eDGzLCYPNShrUqBCHtzXOVhqMjD/K+4apVVJu4uReSM8tWinBGvmY+rV53I2X0so6thBJafUYMwliBaBG6vmjexE2vh8at9OQxbd3Gj0QOt4pIyR04BHIjv5Usu6402GUil0SPTbIW9C+tmP+yXWQ8Thth5NB9r2Jw4x5Ii0n8oGXd6o2yo1PmRRYgjSZtjstaKyTI95CKD99IzssBQdaQERDs3AzFCcdK+8do8n3ZVeOzn5KETmSKZCf5TbwqaVIfHe9d0AEfn0tCQyLtERfB2MT5j3T3qwQ== 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-SenderADCheck; bh=Q+9dftFW6tCilO5oddjucx4wzEQ19EYrlh6w6k3261c=; b=FmJCXuLyVK8sxTvOj/x/zc2o4TYkCXlUD313HjYg9QxiM7mIJI/bnwXJ9d23RuxVligxHGloY/f1coFrYd1P6CaLi6jKLCYyVE2vttr+nFUui10t5DPgmccahfJ1CGPJgD6I7IpqrM/EWcA08hZx6eZ7Deibdd4D6hjFPJD6iQDxYGnGTXKhH6Cs7sUmK66/uycV5PZKmWCGPhAtSeRzaeaeGCAuK4U+7KcgLPuaoJqQJh8VDvwiW6AnZQmnquerSy51OLLP0m+n1m5WJERajrD3I7kqtmPJg8Vxa9G2zxDGVOJtIDXuD2SKJA7LwwXzwuM6ZLjJMUdwHEQN9kfQTg== 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=Q+9dftFW6tCilO5oddjucx4wzEQ19EYrlh6w6k3261c=; b=Mu/z9AnKJEmhc5WtXqtn1D1sVre0KRIELilKdjweZgkwJbJwMtcRD8iAeFe1dPIPIo5ACSVPHyOR39cFQuDyoVAtOvukCYiQ0XlpxupEHBKtEVRn2kSqkSy1EjCejARMmoS8ba9UNqjoJTwo6K4xTVL5b0VHyV29pro5cDqC8T0= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:15:02 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:15:02 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 12/13] aarch64: Add pac-ret support to asm files Date: Tue, 12 May 2020 11:14:48 +0100 Message-Id: <989dc57137130a177cce15b181d2a95e3214a8b3.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:00 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 749e324f-2e0d-462f-7f3c-08d7f65d59c8 X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|AM7PR08MB5511: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: eBqZRpELa3luhpk0wBmqbFHY0g6vlaHdGooaBeKrvQ0DqizECCtB+LNgI10+G0t+1gwLoP9JF0A1tlPM3SPcWdVumhfXawGt1PGuGuptYmJ8l3/ja6YEQ1aSHidH8JiUzsEmaXglUJtEabbJH326scT5jKZuGrDHwcexJJPmARwTlSSmkBlqgZv85YJ5uG7n3A9O0qC9onxddO875d8x6L+a7GN85tZo5Uu/Dmdy5zQJleVpKRAZ6m8oT+x+Kme1iP4S1iHpDSDAPZd9iicNhjpIuNDeh4NJRlzzxgm/fBQ87YZ+iQ2gm7p+dr+qaxUaWlGNPPlbTJD1CtHaZTlYscg5uMwoIMygh78ooYlJcO9QX0Sa5sx0SP5U0u6HMCZVL/uWDQfgWS6lajLTJa2I8TxlZuHJyLED7rf90L+W9bQWJmjARZr3xHXx172EfcKXWItUU+T9P5hiVczJdD4MzOrFcnK4RV83iuzURnG7OgUirLrvHXKK4we6NeWPrgmYGNV2Dk6+jnweUpUiukgnzO0sj1Ya3EdmQkgTXRqPU6+SvpJ3UnKMFQGVM75W6om26wKHk6c/2x/nmVsmgAC60JD4LoxQwdyN6FBhpsDUe0c= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(36756003)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(33440700001)(6666004)(478600001)(6506007)(6512007)(8936002)(26005)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: p0QuLFHnUOTP5WM4hbNT/rGmV2A+hCwXnD8uaqoMcj8bXV7SRvL4sTqXO52moVnt0yMIQYqQEp4I8qRkitpoo87efJ1brtxCkY8Rl+tIPso8tzutUUTd/eSfjDXKARsN6ydDl/vbP027XtWLlu2o8ImSshN85eTfZLA1nb3qjY4PqfRnf9Dh01lj8GDKf7FvQW4CYLkDUCk6LDZWfyDms0VE00kFaCP1YJz8NkuwJ70E/QmCz29auAvV7oWP4dKNunO2pSWe/V+XzXRguDxQz0vCLzPefPDNEaGSvf1/K6wXmodxm64Cm/IaVShkGRWhurMn7ttA4VRnItFA01bFe6Ue3CgtOaNasGGWqksQID8a1AHyc/k/N4BV7gSZbUE3bn949iX0QSH2ntuOh/prEkfn64KUelaGfC0bmCAhmAcGpuzQgZ9GVrC1nfr6u9qI/25swzIiC+VJNxqfNhI21MaiAZQoLeWVZUXWP6JsZ80= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT064.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(346002)(39860400002)(376002)(136003)(396003)(46966005)(33430700001)(186003)(44832011)(6486002)(36906005)(33440700001)(316002)(82310400002)(16526019)(2616005)(81166007)(6512007)(6666004)(8936002)(8676002)(70586007)(86362001)(6506007)(36756003)(26005)(47076004)(5660300002)(82740400003)(6916009)(70206006)(356005)(2906002)(956004)(478600001)(69590400007)(336012)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 37ada92f-f6e5-4a7a-27f9-08d7f65d54a9 X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JKIQ0774aDa9g+BR/Q7I/8MUWmqXPbtQzuSIgaSnMIbU8WqGnwUo41rXeqwXYm/1bDmJHTv3GzCG3MVBu3prZDtekTHGKal1LdAumphk0BkLYgvOqWv2ua1t2qNx713FYHut4TJW0RsEQIK+GnvfbIbM0UAlV9XsMvNglQ/JhexIDO0y3O3LF9pWFwkjvXsX23Cx2ESLGnlDn8Qeaq55tbc3X3bRETgPLh6yQDFP6CGKznDrlj5u7gUBdnCmRLnh9Eg/+GzbBFLzV+CL0zKSusJoAWBayNMo+phZnCosE62wH2ttOwKZHqMSAXTq/sUFXbe4AZHvuOAPMfOtnmSDj5zRBSCiSBQPIf9MT4EwHY7SOz50yWOMP8NcW+mqExJ2TvLaEvJfXCUiQSL/6bOVI66HHe92/mRC3+ygAGu+1klGbAoKJ4chiCzKJdaXylU62bmpGj02b6/Ix3aBpy6TUk0wPxDPFDgb8BjW4seCag4OONt/cN74SR8vciElvO/lswzTJqU+FmX5WwuQ55hlm73NvuivovS1FlNl6x+Y9J4JKR5ozt7zuQIkomEANSQWRhxSkR9OUnp6e025ihAIzGH2b/YA+brlxwwCDFWJZGctbSnM1cNmXkY+zzROMv23TTlbcMKcHiM+5djB7oP03g== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:09.4308 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 749e324f-2e0d-462f-7f3c-08d7f65d59c8 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5511 X-Spam-Status: No, score=-19.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Use return address signing in assembly files when pac-ret is enabled in the compiler. The GNU property note for PAC-RET is not meaningful to the dynamic linker so it is not strictly required, but it may be used to track the security property of binaries. (The PAC-RET property is only set if BTI is set too because BTI implies working GNU property support.) --- sysdeps/aarch64/crti.S | 8 ++++++++ sysdeps/aarch64/crtn.S | 6 ++++++ sysdeps/aarch64/dl-tlsdesc.S | 8 ++++++++ sysdeps/aarch64/dl-trampoline.S | 18 ++++++++++++++++++ sysdeps/aarch64/sysdep.h | 8 +++++++- 5 files changed, 47 insertions(+), 1 deletion(-) diff --git a/sysdeps/aarch64/crti.S b/sysdeps/aarch64/crti.S index 89a9e25f5b..1ac3d26c75 100644 --- a/sysdeps/aarch64/crti.S +++ b/sysdeps/aarch64/crti.S @@ -75,7 +75,11 @@ call_weak_fn: .hidden _init .type _init, %function _init: +#ifdef HAVE_AARCH64_PAC_RET + PACIASP +#else BTI_C +#endif stp x29, x30, [sp, -16]! mov x29, sp #if PREINIT_FUNCTION_WEAK @@ -90,7 +94,11 @@ _init: .hidden _fini .type _fini, %function _fini: +#ifdef HAVE_AARCH64_PAC_RET + PACIASP +#else BTI_C +#endif stp x29, x30, [sp, -16]! mov x29, sp diff --git a/sysdeps/aarch64/crtn.S b/sysdeps/aarch64/crtn.S index 94a6f970ef..84741701f3 100644 --- a/sysdeps/aarch64/crtn.S +++ b/sysdeps/aarch64/crtn.S @@ -41,10 +41,16 @@ .section .init,"ax",%progbits ldp x29, x30, [sp], 16 +#ifdef HAVE_AARCH64_PAC_RET + AUTIASP +#endif RET .section .fini,"ax",%progbits ldp x29, x30, [sp], 16 +#ifdef HAVE_AARCH64_PAC_RET + AUTIASP +#endif RET END_FILE diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S index d55e0443aa..272952e4f5 100644 --- a/sysdeps/aarch64/dl-tlsdesc.S +++ b/sysdeps/aarch64/dl-tlsdesc.S @@ -183,6 +183,10 @@ _dl_tlsdesc_dynamic: callee will trash. */ /* Save the remaining registers that we must treat as caller save. */ +# ifdef HAVE_AARCH64_PAC_RET + PACIASP + cfi_window_save +# endif # define NSAVEXREGPAIRS 8 stp x29, x30, [sp,#-16*NSAVEXREGPAIRS]! cfi_adjust_cfa_offset (16*NSAVEXREGPAIRS) @@ -233,6 +237,10 @@ _dl_tlsdesc_dynamic: cfi_adjust_cfa_offset (-16*NSAVEXREGPAIRS) cfi_restore (x29) cfi_restore (x30) +# ifdef HAVE_AARCH64_PAC_RET + AUTIASP + cfi_window_save +# endif b 1b cfi_endproc .size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S index fba5689d09..3ff9bddc7b 100644 --- a/sysdeps/aarch64/dl-trampoline.S +++ b/sysdeps/aarch64/dl-trampoline.S @@ -127,7 +127,12 @@ _dl_runtime_resolve: cfi_startproc .align 2 _dl_runtime_profile: +# ifdef HAVE_AARCH64_PAC_RET + PACIASP + cfi_window_save +# else BTI_C +# endif /* AArch64 we get called with: ip0 &PLTGOT[2] ip1 temp(dl resolver entry point) @@ -239,8 +244,17 @@ _dl_runtime_profile: cfi_restore(x29) cfi_restore(x30) +# ifdef HAVE_AARCH64_PAC_RET + add sp, sp, SF_SIZE + cfi_adjust_cfa_offset (-SF_SIZE) + AUTIASP + cfi_window_save + add sp, sp, 16 + cfi_adjust_cfa_offset (-16) +# else add sp, sp, SF_SIZE + 16 cfi_adjust_cfa_offset (- SF_SIZE - 16) +# endif /* Jump to the newly found address. */ br ip0 @@ -287,6 +301,10 @@ _dl_runtime_profile: /* LR from within La_aarch64_reg */ ldr lr, [x29, #OFFSET_RG + DL_OFFSET_RG_LR] cfi_restore(lr) +# ifdef HAVE_AARCH64_PAC_RET + /* Note: LR restored from La_aarch64_reg has no PAC. */ + cfi_window_save +# endif mov sp, x29 cfi_def_cfa_register (sp) ldr x29, [x29, #0] diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index 161d63c782..d8a5445b7e 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -45,6 +45,10 @@ #define BTI_C hint 34 #define BTI_J hint 36 +/* Return address signing support (pac-ret). */ +#define PACIASP hint 25 +#define AUTIASP hint 29 + #define FEATURE_1_BTI 1 #define FEATURE_1_PAC 2 @@ -62,7 +66,9 @@ .word 0; /* GNU property note with the supported features. */ -#ifdef HAVE_AARCH64_BTI +#if defined HAVE_AARCH64_BTI && defined HAVE_AARCH64_PAC_RET +# define END_FILE GNU_PROPERTY (FEATURE_1_BTI|FEATURE_1_PAC) +#elif defined HAVE_AARCH64_BTI # define END_FILE GNU_PROPERTY (FEATURE_1_BTI) #else # define END_FILE From patchwork Tue May 12 10:14:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 38966 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9C2CA39574C0; Tue, 12 May 2020 10:15:15 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30087.outbound.protection.outlook.com [40.107.3.87]) by sourceware.org (Postfix) with ESMTPS id F3731393C8AC for ; Tue, 12 May 2020 10:15:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F3731393C8AC Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@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=w1RScHoubRk/4PQwP/u/2g90gK+K8wI+YhIhkrhXJCw=; b=wRwftdszfm2Bpr473uVzSUUZqbKeCe2vOQn8cauQwdyeQBHCvFltffAR7e0Q++n8y4OchDKNMPaf9pPyuiZGRL+TdhAi/SIyFDYvzHA60YPnQ+1FKa2IXAVrQCq3cQYd79JqSW5u0EzEDdoi4aijGSeaZ/iPOSB1B/8bLllm5yA= Received: from DB6PR07CA0160.eurprd07.prod.outlook.com (2603:10a6:6:43::14) by DB8PR08MB3962.eurprd08.prod.outlook.com (2603:10a6:10:a9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 10:15:10 +0000 Received: from DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:43:cafe::b) by DB6PR07CA0160.outlook.office365.com (2603:10a6:6:43::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.11 via Frontend Transport; Tue, 12 May 2020 10:15:10 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT060.mail.protection.outlook.com (10.152.21.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:09 +0000 Received: ("Tessian outbound 567b75aed2b9:v54"); Tue, 12 May 2020 10:15:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fb7ed153c1e5a674 X-CR-MTA-TID: 64aa7808 Received: from 6886d957944c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E2C66B23-E9A4-4201-8B4F-88F18E9C1208.1; Tue, 12 May 2020 10:15:04 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6886d957944c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 10:15:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CZN678JAaEomnTNde6gFkrEQnft4D4e1uobRDS7Rpf8vgwCocj8vxffM7qVHXncJzjqunOx3agGwWuKilFPgt4M1oEwr1BXuu0FzFZYP1O3gvVuEU+oaGyNTedvOfyCuvAEaleLDQEGWXL0EHijUtZfDjhUMoqAQ/pJ3hvaXtaysXH6S6p+OfoG7cxEMg7gmsxe1qPAg+7K7l8D38cDSkjmkXv5ipwmf132N65wLhTHkbXfhaps9UpZRaVcbEOGMCoiHX5Var02txNOUAirUNje0X0oY0/fv5sLDF2IoBzjujvKdaOgc2JLRoYkBXrn85+jPTp3cRf60iyFgYyBN1g== 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-SenderADCheck; bh=w1RScHoubRk/4PQwP/u/2g90gK+K8wI+YhIhkrhXJCw=; b=iIBnwibWRH7eC+Lq3GqrofF//YEfDMXj1gh5IeqVfq1P9V+Jn6Qpyio5QAiAGpyIFl+ZgpLQbVz1Wa9rEZd4qDidRUdIk1H+q1JFfrjrjtyG54V+QJLJ20h3PxrgBNUkWfFuOg0Pn/Pyo70mjQ9hqEHK8AhTc+0pVPUzLmBvYBh/5Ie078bzvGlLfLOgNUmFnhv4z12hxQp4tOfhJ3BkPrKGXOyl0CHD+zJr6viYS4dos25TWSW/YFWssOQCaXt3tQ1Q7RoHY9vEn5k7L0Lh+D45KMb7C80e+saijonUQbHgaWlourgOCoqIpzHyiNPejP/6ZHBx4e+Gmkle3us0Cg== 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=w1RScHoubRk/4PQwP/u/2g90gK+K8wI+YhIhkrhXJCw=; b=wRwftdszfm2Bpr473uVzSUUZqbKeCe2vOQn8cauQwdyeQBHCvFltffAR7e0Q++n8y4OchDKNMPaf9pPyuiZGRL+TdhAi/SIyFDYvzHA60YPnQ+1FKa2IXAVrQCq3cQYd79JqSW5u0EzEDdoi4aijGSeaZ/iPOSB1B/8bLllm5yA= Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB2982.eurprd08.prod.outlook.com (2603:10a6:209:43::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Tue, 12 May 2020 10:15:03 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 10:15:03 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: [PATCH v2 13/13] aarch64: redefine RETURN_ADDRESS to strip PAC Date: Tue, 12 May 2020 11:14:49 +0100 Message-Id: <87577148c5eef249758478888556a3aeeb505d97.1589277641.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.55) by CWLP123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:59::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 10:15:01 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 814b689c-0512-4fc8-b51a-08d7f65d5a0f X-MS-TrafficTypeDiagnostic: AM6PR08MB2982:|DB8PR08MB3962: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 1TrcLOUipfI1nrLagBq+rh0yRe7FVaV/RB0ez5IdndGM0CJ7JdXb5qslTVC3d8c0gRdGZSueUG6Y066UxexSjhB3gX5unq8H8EDNcIfN3/cwxZaQxpRZMQ2ZVJtrNqloMLkjgnPcjbvkuOX/VCvg2QqhbY7YkUMvO4wWTsDMdOq7IbuNDgzfiutAiybbJu2sKXrK0bEEMYjwBdFCeU5bxtgX65jyoFov+HUl5J+VnMlpHYTVsrBHjeJdUMKqZiZYDAXUFaIsgOzbvMLZXFqRFLiXTU3QvXtNZNqk64ppGhCYNf7fG6CkBSTuqeE/Cck8xRi5RLtO7l/qoYxibP/jQmyUQtoPKKWSs3vQ0DHV4gNypt/Ee0OCLZiNVslm9xwFhzhVnTY7GMXOx3qNfjl1Z4fgG8WNPwjA9ctEIRqxdkX6pUUaqfbQSuFIzNK+o0mO2ctPlNxL16x84IqHKRArpHocDR87MhqFFWA2puReB8SF9zdcmCOGydFBINbpy+kiZ2TMo0V9cahT9KOU3Y/H6Oyaw1AT+O6AbOY1x8ih2aWWjcQOSAGRPHcfIo7weSAdePp453r7L+ZkfYO2juhKFYaQnI3LRLTNuQ9Q3uhCTjUuoJVwF3COpWDYttQ7K0m1mquNodGUmY1J/RC3OYtmbBGRNE0eLF/jfy06aSJFcYH4piUnw73lCH+NxoSYQHwy X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(366004)(33430700001)(6916009)(16526019)(66556008)(66476007)(36756003)(44832011)(5660300002)(52116002)(86362001)(956004)(8676002)(66946007)(69590400007)(2906002)(6486002)(186003)(316002)(2616005)(33440700001)(6666004)(966005)(478600001)(6506007)(6512007)(8936002)(26005)(136400200001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: q967AoqriaKOlD+qj3qXjJMd5k+fR+dk5Q+9D4da83O7l98vyHyabL83t7UHSMRlUv0H++HFILEORL3voM6XJFn8w92+ingIqawWo9HP+gsuEg8BONXTQyITZZ4UsH5L+67lcYwwIeU1XAdEkLE+IAm+74R1yCdOVi3Ow7MEg0opu1552JnITFkMa3S/g0rHz7X9vUULKB3BqyA9qYLiOY39RWWQTRAZ9R195sQ67Q0d3IQ2b2YGrOsHYC07QGlCrc/Uf1C05OxlzdY9/zWkLyEfc61SmJd3DWkpMKAi2Zlgj0YHQ90Zse/HyYsH1J07EKDFLoabEGO+y7JRyyL03JZKK4mP5qMobXAHDEp+hjfYMMFbauWGyfzneZ/cKbvrJEe6UjSUwkVbOJY8uioHFjW6Gmt+17UEOyGqZiIRCCm2aJ1BatSTGzBq5nPOqsDj2iVOeiu1cjY3t6plg84DCRMr7tmx8Pj1wQ7F5nnznIo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB2982 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com 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; SFTY:; SFS:(4636009)(136003)(396003)(346002)(39860400002)(376002)(46966005)(33430700001)(16526019)(8676002)(70206006)(6916009)(336012)(86362001)(356005)(82310400002)(26005)(36756003)(47076004)(70586007)(956004)(966005)(5660300002)(69590400007)(2616005)(82740400003)(6666004)(44832011)(8936002)(186003)(6506007)(81166007)(316002)(33440700001)(478600001)(2906002)(6486002)(6512007)(136400200001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 982c7731-5a33-4ab4-a556-08d7f65d54eb X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: On9l12Q6EZrHT6UevjWiZjf9/kw/33Bdf7nB08fDIwGz0tXShaN5hpB7rhvEUQZ16EiI8NzQ3H3yYWYDcuNbaAgYg4V2Szrgdc7a9iAutkPTtAv/13GqsRchYmSMNF5rqM7RgOc3SswIvKZrIVIpqD+mGQjIcL1B7y2OSjNRGxQ96hYBeC4v2taAigYA5hzEAtdW5YrtNHqLUeBoZEW1p0XsWwMsecWzw7FWo4W09kAolytHmiw9yAwTxBzdpuQbjMEguf95Ld5q2AsJeP9Iptjg53wFuOYF8BDEh2Ld9aKrR6MW3RxLkYPsWtC+o5zKVd8kOoS9WejvWMLjJoOz2DM9ehfSyxYyEBMX5fxCtTCSPNXPjC83PS5ey3EP12L2FTp/S9CTAb1PvO/b8kAwEKRZsFHbuU8CytJzSJo7Y9s23saypjhIt2Ox+y8QZ8yWRqkihPpALA6uLLNLFdSoGxUarBT/BoLVYd3+ROGVAWsQFlveLEnzynb5mMSs3Gwaxv58+yvkgfJtI+wYMco1/AzMlIx1b6rBR8XLbxp5TCzr+Scal3qi4p7RwhmVllU9V7H+3imwBWf6opgyabhTYkMNcZGOQk1nvqDRrzMc6TR9l3kffQ/3J5diQwOBwQZhc1cC5CcrQ79LodOTOvZvB1i4uvKOK/EFLuIJbLriy9tt/U4ZG9YiXK21s7ezW8ATF4JAPuCrlScAzJEqMw1bVjbsBCzc3k0VgDA53DmbPmE= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 10:15:09.9509 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 814b689c-0512-4fc8-b51a-08d7f65d5a0f 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB3962 X-Spam-Status: No, score=-19.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" RETURN_ADDRESS is used at several places in glibc to mean a valid code address of the call site, but with pac-ret it has a pointer authentication code (PAC), so its definition is adjusted. strip_pac is omitted if glibc is bulit without pac-ret, but it could be added unconditionally (that's just unnecessary operations). Inline asm is used instead of __builtin_aarch64_xpaclri since that is an undocumented builtin and not available in all supported gccs. Note: such change indicates a problem in the pac-ret design: it can break code that uses __builtin_return_address and the breakage is only visible at runtime on a system with pac-ret enabled. It is not ideal that users need target specific inline asm to fix this up. For now we can recommend disabling pac-ret where this is a problem, but gcc might need improvements in this are to make pac-ret usable. TODO: __builtin_return_address handling with pac-ret: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94891 --- sysdeps/aarch64/sysdep.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index d8a5445b7e..2c12aa902f 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -35,6 +35,23 @@ #define PTR_SIZE (1<