From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2077.outbound.protection.outlook.com [40.107.21.77]) by sourceware.org (Postfix) with ESMTPS id 2CEDA3858D39 for ; Mon, 1 Aug 2022 14:19:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2CEDA3858D39 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=FfBOc/CpjVToCRWlW7HREpYduqjG4iMaEym8UBRX9P+tZMsp6ssD31K7sbuPtG9LKo3mVruDGMncZNPs3EOyq9KDeCmmNpccZ9rEMnkcSgfUg2pv233+K0jKFCGiIgQmVW7ng0WSStX0fjIh0v/IgL3832NoSkHA3saeYFLh51ERJwEICohokuM5TklbxU8EpA2hljkrrHUOvO9Ovtn2mahnvIwD2MGNBdWRRfNwSlKZRoMtJYoSYSa8rtswoDV5ITupvD79NUnUDX6VnK7IoErWwkjWPt64IhFG51ELvkH3H1OjdXej4EkU+adNSBb56n8XBW2sgl7rLyfjm285gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KnxwK/0ehPuuhO5+rLyy7R7o9kpRBeYwxMvDoQPqeVE=; b=cdqGjAi2r7Di04tFwUsYKeFKh4OXKTaQ0d+B2gyRF8EeOtO9gYCW2FvgPh3D9VV8whxvXwYr79ZLe7MU84t2MQCOiRL1hR/X7z/jbBcR+12sGLPLU/cXJJoeG93XAzJi6PFNBSKTvCf2rWv5Dx0W67zjBjMhScep6VSXIsPRuCJgzuBPti5EgSbAad7jSijngJymAzLVukfrNSDE/511UB0OxRUsFAEIucwdXwwo94D23TszwVrOlkSJ4iUlbL4m+bH29TZEuKsKDAB+xBZ9h78e+CCgqQsXXAMf2Svc9ycLxWUkH2LO0zVW0y1TSvZV62qC4DUx2LTQjqD1kVpZgg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1, 1, smtp.mailfrom=arm.com] dmarc=[1, 1, header.from=arm.com]) Received: from AS9PR06CA0017.eurprd06.prod.outlook.com (2603:10a6:20b:462::13) by AS8PR08MB6374.eurprd08.prod.outlook.com (2603:10a6:20b:338::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.11; Mon, 1 Aug 2022 14:19:00 +0000 Received: from VE1EUR03FT007.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:462:cafe::24) by AS9PR06CA0017.outlook.office365.com (2603:10a6:20b:462::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Mon, 1 Aug 2022 14:18:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT007.mail.protection.outlook.com (10.152.18.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12 via Frontend Transport; Mon, 1 Aug 2022 14:18:57 +0000 Received: ("Tessian outbound 73dd6a25223d:v123"); Mon, 01 Aug 2022 14:18:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e6ed53323f7ed713 X-CR-MTA-TID: 64aa7808 Received: from 489c6cfe2cab.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4491570E-F858-4DEA-8276-3ABED4A43B8B.1; Mon, 01 Aug 2022 14:18:51 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 489c6cfe2cab.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 01 Aug 2022 14:18:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nz5mQF9nex+suXje2zRZ65Q+//VHUDT4+LFE93skQhPRCw6YAh6vIpTSMAckU59lBLFAEJZFWL4XTkFY7UliQnHnK5miiI3+X2/GWBMR+khpKeLx1Sser8BkPH2GOAJKp/qpdIOBAR0qQW+A7wwi0Hzhcnis1SqhafPIC9Dmlq3H9XBny9Ubticwt9tljaLLowWU2BIkR3LgnUBoj7mLA8yOM+dMmtbtfZYkdnzFqVwE7qNApvPwHbvL6EHqmxCsDd5o+hpxZE+inkGip0FDek2ujxaAz2h8sDGvZPnKTUAa73xUJRwCJ3vDKcWV24iCnOJecaNlJwISZSj9PsaJWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KnxwK/0ehPuuhO5+rLyy7R7o9kpRBeYwxMvDoQPqeVE=; b=YJ76SLZbOZCNayRgPI78rL7iL8KkRjKmWQ4q3hB9kjYG2hV7vyluetMwfbeNNuRTJBL7eu5/gnJ/fEiTflUzpx9UuejWVBTDvTUF4CGW4XyRcocUAq6snICKVVyDLeZAfANBKxPqtLoQfxn6yKRdt6UuyAt1/yYi/16k8/3pRUBoA8G/HZTuBqg6RQd5J3tSY2Qox91mmkN0XOetjcjYA2mb6A/8ebAWTVVgqUzbsyS5N3nR0h6m03RLTuqnLzvbywhuMLUHrkkcPiZgmhkshnf+XfUBzBin5PdGTf9WPhQtcjShEzJeEXGGchhlt+z4RHtWwFoBdS+zRyorV7eEgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from AS9P194CA0023.EURP194.PROD.OUTLOOK.COM (2603:10a6:20b:46d::24) by GVXPR08MB7703.eurprd08.prod.outlook.com (2603:10a6:150:6b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.15; Mon, 1 Aug 2022 14:18:48 +0000 Received: from AM5EUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46d:cafe::cc) by AS9P194CA0023.outlook.office365.com (2603:10a6:20b:46d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Mon, 1 Aug 2022 14:18:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT029.mail.protection.outlook.com (10.152.16.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5482.11 via Frontend Transport; Mon, 1 Aug 2022 14:18:48 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Mon, 1 Aug 2022 14:18:47 +0000 Received: from e125768.cambridge.arm.com (10.2.78.50) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Mon, 1 Aug 2022 14:18:47 +0000 From: Victor Do Nascimento To: CC: , Victor Do Nascimento Subject: [PATCH v2][Binutils][GAS] arm: Add cfi expression support for ra_auth_code Date: Mon, 1 Aug 2022 15:18:42 +0100 Message-ID: <20220801141842.15898-1-victor.donascimento@arm.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: f1132813-c527-40df-f523-08da73c8c616 X-MS-TrafficTypeDiagnostic: GVXPR08MB7703:EE_|VE1EUR03FT007:EE_|AS8PR08MB6374:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Y4cL/8zpv3chuc9go4Ea1MX4g/S0mDaOsvM3uMTJ+CZoIxmfZubYnBKAU2dBPrrgVdTRcvN+n3W4EalN8WXva1CLzvD4KYGB6WhVSNbW1ORR46CWVv2hudziQjczfgsdYW2/HZNJCQLmJA2jeSmphRJbphAls4xRbKy3ofEAUXjz+Jz7aAQo8e3LWdaE/1kRWMTf7hE5jehhEy8QCle1Wp50v0SpiTS/ze4CiQPR8chjNnsU61J8RiqJQnHwmHx50IWIUNMpS+puyVTBuXss4DFvzPzicQDDegvv4dgMYf7SF9U7Nu0QdkULDyuaZXtM0Y6ScYpZqEU7OYZ0S13BtOZ35tnFDEPmSgvXu4jL+dwqXV7neqhFeRegLzbGKtwApQb3FmKwIZrYeRJ0pRuEPRUv0l6UchP6E+LlaM3UfuP8cgkDIX12TOXF1906IAGd3YzD4L0QrO8W9OiS6BJmuucfb12yB4XwhmTAxSJALHHJmeRGGo5siZfqpScu9Y0AzabpDAeU96jT71fQ3/fToECdlsPziSLdAj4omB/NXwg2OomapfmCouuelQr0dZQ0hDpM2p3Wm64DnCPbVReZ/v+3fPeHamBKA+mQJccuZJWCtSZjRfYlMX+5BsNIYVDjmXYmcJb00Hcntr8Ig8iM4Epx2wClldUMXfnyMC1TX/ybNeha2TneDKWjZrOqdfv48JthN8/lJ+HaSxpZ7g8lGLK8I4iCCD/YrgHJpioDaisvViMWioFPr/CLUC0osVhdasA4h5s+vJaTZ7XOaJgHivVPrX+f5FeHSKCNXWhlsHfm1pdlkR0iTj1e61R74nMSJCA9MtlRghC/CqUq1XY18g== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(136003)(376002)(39860400002)(396003)(346002)(46966006)(40470700004)(36840700001)(40480700001)(86362001)(478600001)(316002)(54906003)(6666004)(26005)(40460700003)(6916009)(2906002)(81166007)(41300700001)(7696005)(36756003)(70586007)(70206006)(36860700001)(47076005)(4326008)(356005)(82310400005)(82740400003)(8676002)(426003)(2616005)(5660300002)(186003)(336012)(83380400001)(1076003)(8936002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7703 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: fcfcff93-7d87-4645-4e3f-08da73c8c059 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T5Xuff6okAlA37kzIKI/mg4uMQ1k6fEMKiiqTyIE2HtgMfJSfD8aaIC6VOkMvEmmg7jSO9a5H2DoUxVHJbY0ItBWazcCig6zAsT6hiEep4WaRyS8qCzTPbfr5ktLqqbwrfy2I/tumwzcRT40nyNOjGd6W2F7Yp/2WFW2iAk8S8V4rLWlSITNG1Jx5rYE7flGsysPlO5hVcFDlkv02HAOq4iwnPQHwWUkUyYp8AYwVvLXVqOiwJpwAHHON5zB3hMbOQaW2xYgbf5B7oOFt9++igApCXY+A9U+PMajh4IislgmGclK03EzRaiNm8fNELm89kEHxzy9Ihdc3pWy6eIBQKKhed2+SKRK/miRRO3kXLUcan/8zLYeWF6lrnd2Gk26PJ1ezRXmPxBOOeJy2FKYQ2BTMGDIruuTxFu8Cm+wB4J5oueGTEYNB0aUEgaRTp1lF3rRy/hZggtTYSASrGQCAKeaOUL11lfRI0FgtuXbgxlNMiI/PHvMO+9ZQC2GEJjjA2XzOdhqEdvQE/OWMn0Eulfw9Ni/NDR/qgNz3k2d5A4xZ9fn/l15+1ufXgkYeR0qhtmmkwN72ngV7Mck1TgnJAk0H+jcXanyj+ms7ndsfejl4hxBlSjHhpIUSax9a7CSuWIqHPhFTWtW4F4txUVfbP2TYnc3SK24c5eD7vLp5s3v+83dxDOp+V1WHIMWZ3GWXAoz8PwSAzwZRyCdu2Se1RFxLt9N+Gglmnt4aO+x2ce29BjS9GaYs5JEbHh6RTzjfYeOwPuPD6bliTj3U66xAg6Dbd7mHnCfjMriob4r5fgINCrNPG+kRRdJBpqSXT1Q X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230016)(4636009)(346002)(376002)(136003)(396003)(39860400002)(36840700001)(40470700004)(46966006)(316002)(40460700003)(6916009)(82740400003)(26005)(54906003)(5660300002)(8936002)(81166007)(70586007)(83380400001)(70206006)(2616005)(1076003)(186003)(426003)(336012)(47076005)(36860700001)(4326008)(8676002)(6666004)(41300700001)(478600001)(40480700001)(86362001)(82310400005)(7696005)(2906002)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2022 14:18:57.9299 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1132813-c527-40df-f523-08da73c8c616 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6374 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2022 14:19:05 -0000 Hi all, This patch extends assembler support for the use of register names to allow for pseudo-registers, e.g. ra_auth_code register. This is done particularly with CFI directives in mind, allowing for expressions of the type: .cfi_register ra_auth_code, 12 Tested for arm-none-eabi. Thanks, Victor. gas/Changelog: * config/tc-arm.c (tc_arm_regname_to_dw2regnum): Add REG_TYPE_PSEUDO handling. * testsuite/gas/arm/cfi-pacbti-m-readelf.d: New. * testsuite/gas/arm/cfi-pacbti-m.s: New. --- gas/config/tc-arm.c | 4 +++ gas/testsuite/gas/arm/cfi-pacbti-m-readelf.d | 31 ++++++++++++++++++++ gas/testsuite/gas/arm/cfi-pacbti-m.s | 22 ++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 gas/testsuite/gas/arm/cfi-pacbti-m-readelf.d create mode 100644 gas/testsuite/gas/arm/cfi-pacbti-m.s diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index e28085310c8..fed70e334b6 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -27933,6 +27933,10 @@ tc_arm_regname_to_dw2regnum (char *regname) if (reg != FAIL) return reg + 256; + reg = arm_reg_parse (®name, REG_TYPE_PSEUDO); + if (reg != FAIL) + return reg; + return FAIL; } diff --git a/gas/testsuite/gas/arm/cfi-pacbti-m-readelf.d b/gas/testsuite/gas/arm/cfi-pacbti-m-readelf.d new file mode 100644 index 00000000000..997ea75f179 --- /dev/null +++ b/gas/testsuite/gas/arm/cfi-pacbti-m-readelf.d @@ -0,0 +1,31 @@ +#readelf: -wf +#source: cfi-pacbti-m.s +#name: Call Frame information for Armv8.1-M.Mainline PACBTI extension +# This test is only valid on ELF based ports. +#notarget: *-*-pe *-*-wince +# VxWorks needs a special variant of this file. +#skip: *-*-vxworks* + +Contents of the .eh_frame section: + + +00000000 00000010 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 2 + Data alignment factor: -4 + Return address column: 14 + Augmentation data: 1b + DW_CFA_def_cfa: r13 ofs 0 + +00000014 00000020 00000018 FDE cie=00000000 pc=00000000..0000000c + DW_CFA_advance_loc: 4 to 00000004 + DW_CFA_register: r143 in r12 + DW_CFA_advance_loc: 4 to 00000008 + DW_CFA_def_cfa_offset: 8 + DW_CFA_offset: r14 at cfa-8 + DW_CFA_offset: r12 at cfa-4 + DW_CFA_advance_loc: 4 to 0000000c + DW_CFA_restore_extended: r143 + DW_CFA_restore: r14 + DW_CFA_def_cfa_offset: 0 diff --git a/gas/testsuite/gas/arm/cfi-pacbti-m.s b/gas/testsuite/gas/arm/cfi-pacbti-m.s new file mode 100644 index 00000000000..515400d86f5 --- /dev/null +++ b/gas/testsuite/gas/arm/cfi-pacbti-m.s @@ -0,0 +1,22 @@ + .arch armv8.1-m.main + .arch_extension pacbti + .eabi_attribute Tag_PAC_extension, 2 + .eabi_attribute Tag_BTI_extension, 2 + .eabi_attribute Tag_BTI_use, 1 + .eabi_attribute Tag_PACRET_use, 1 + .syntax unified + .text + .thumb +.Lstart: + .cfi_startproc + pacbti ip, lr, sp + .cfi_register ra_auth_code, ip + push {ip, lr} + .cfi_def_cfa_offset 8 + .cfi_offset lr, -8 + .cfi_offset ip, -4 + pop {ip, lr} + .cfi_restore 143 + .cfi_restore 14 + .cfi_def_cfa_offset 0 + .cfi_endproc -- 2.36.1