From patchwork Fri Nov 11 10:51:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinath Parvathaneni X-Patchwork-Id: 18670 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp668381wru; Fri, 11 Nov 2022 02:52:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf4EUrlo/i5NVp4sQ4tZn51MLWAhDK86oJnHlVZWKl+EAuI7Ge09h+Urtbg+AK8fj3Lm8Qxc X-Received: by 2002:a17:906:412:b0:78d:85fe:4951 with SMTP id d18-20020a170906041200b0078d85fe4951mr1312152eja.593.1668163936967; Fri, 11 Nov 2022 02:52:16 -0800 (PST) Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ka12-20020a170907990c00b0073dd7598686si1498817ejc.270.2022.11.11.02.52.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 02:52:16 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=W5OO6lBC; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC6F03858C60 for ; Fri, 11 Nov 2022 10:52:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC6F03858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668163930; bh=+raQqUXnNaiY1qHUo9xgc79KRPObQAgyN+x5c83+anU=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=W5OO6lBCytE82kSKbdcob5gHsO7DRXlCO4x/e/7GETQaF5sYWLXcRv9lEkJ7NUvqm 2DYqSGSlDX3aEwM57/XyFWG0JXhwj7tFRuJunGwV1sWXBUOG+MzakcSpmp8wUwfu99 vwDTgzVpknYCwQSKm99bvDdH5rcaoMX86jWeoiL4= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60059.outbound.protection.outlook.com [40.107.6.59]) by sourceware.org (Postfix) with ESMTPS id B108E3858C29 for ; Fri, 11 Nov 2022 10:52:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B108E3858C29 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=L0O18WQCQ2eh1MtwIPgrS02N8WVAzZOR5iMug5M2aekZ1CM4zJXPiMUwQIIS4Cl0OpyPQRIntp1sNgvIo3V5JznmYhA0W6AkEn/IQgdqRwwRXadwcxDjtSNkq+zuoXADfeL1i5VDKKZ38EnYyZ39V7iz84muUfKkWqImD/atLrquZqG8Q5Ao5JIR1jOsKQmoVOMG+lBuAfIZo3g4gpVWAbSLj9ZJV45q5ZqCzG5jhQRA4y3d9L013WH1dPAyaUQ7qOZ3HboGlvq02ayMj+kG23cAq86RUNOKBya7ZanQqpn7x4YTC3o9HAf3S1PmLUECbT5JWa/mhlY8FT/UO+rZAg== 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=+raQqUXnNaiY1qHUo9xgc79KRPObQAgyN+x5c83+anU=; b=JU7BBNNvtqJbI+FzT4aCNbGRx9+mrwhCq6nMzI5NJtZerzMy7mN345nA4n3wYX//+sW3w6c6mpP6kFaMDx7+ZpZC2451g6u8NuYFU7eoyvMWqv1O1jZsUoJ1AI04ICAOTVPGiqAatJgTUorXvb8EZ7GSgxRHJ9XEwLvKiS9Ku4Oz/vgzejUu9SkSPq/vgNmgZoEt5VAAWGLKcrEkTLT3h6C2xoonOrZuzfR/sQOIFj8iAbo3RNpzmKMrW4bca41RwB3GFWSgT0QIEkytDvdz0FxvHLI+eFkuLGVMr6U2JRfXFAFxaGCYgRT4NijaWbmPtCUtzeaDuiCt4F+7JprGZA== 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 AS9PR06CA0115.eurprd06.prod.outlook.com (2603:10a6:20b:465::24) by GV1PR08MB8713.eurprd08.prod.outlook.com (2603:10a6:150:82::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.11; Fri, 11 Nov 2022 10:51:56 +0000 Received: from AM7EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::81) by AS9PR06CA0115.outlook.office365.com (2603:10a6:20b:465::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13 via Frontend Transport; Fri, 11 Nov 2022 10:51:56 +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 AM7EUR03FT040.mail.protection.outlook.com (100.127.140.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.12 via Frontend Transport; Fri, 11 Nov 2022 10:51:55 +0000 Received: ("Tessian outbound 58faf9791229:v130"); Fri, 11 Nov 2022 10:51:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c1f2a53461e97147 X-CR-MTA-TID: 64aa7808 Received: from d6a156d08498.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 063B1FC4-9498-41F1-88E0-54756369220B.1; Fri, 11 Nov 2022 10:51:48 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d6a156d08498.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 11 Nov 2022 10:51:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DD+GZQUloZ/Qv5CEFAq692Kibr3bIiDjBxUAqlYOew7V6+91DFAOO3+1pHfavxVzTe1ouiFsCuFPbF041aOc3vu6KTj+XxveH0CU7NtXG20L/xtAOn0jyXYZf04jY8a1XnFttkMaelFHSdb+Nd/BdlyhYkSC40KuQi9RoSU6laXZhGmV5HHE2LvPBTUpWMyg8qzNzH/uSERfaP1OopOfEd/dC2MI0UTpkvjeNdvPh127Hdzstrs+6h/60PnLlWZyII5MCRLqAMdL9/+tayhcKeAITGpaZ7o6awV1i4+OGqjgCrNkFt9BcRaPys78yOokB8IRFCaBfp773Xkk3UFF1g== 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=+raQqUXnNaiY1qHUo9xgc79KRPObQAgyN+x5c83+anU=; b=B4H9gLNLAg8HjQhl8OiYM89/sh71rC1sV4gZiTx5KUPhfv8d8AhrP6TFE6kz+ZoLI90WzGfHL9DQsFQG81pD7r5RBBiOnjo+nEDf5ej9xHwTtfoNZ/0PjbxYNTGuQM1tHvqx0mS8ao57S3m7LQ5Rhw4JJ87y12w4MwNcwqFZcbPZ30VehRHulp6OY8GDGTHl9Eb52sPq0TQnd7U/3gsBRib5+3OzAbTiXYBBMYKzyLyp6JPpn7FLxDHscvPLMWcwtPJI+iJFeQgtpgwoaQurIraPlg/AhVq2OPY5lBPhnVyNErTJIQZphUlpW0KhxJAUbSRDxNaGlO5J2IqnIGsfUg== 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 DB6PR0501CA0026.eurprd05.prod.outlook.com (2603:10a6:4:67::12) by AS4PR08MB7532.eurprd08.prod.outlook.com (2603:10a6:20b:4fb::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.12; Fri, 11 Nov 2022 10:51:44 +0000 Received: from DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:67:cafe::99) by DB6PR0501CA0026.outlook.office365.com (2603:10a6:4:67::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.14 via Frontend Transport; Fri, 11 Nov 2022 10:51:44 +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 DBAEUR03FT010.mail.protection.outlook.com (100.127.142.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.12 via Frontend Transport; Fri, 11 Nov 2022 10:51:44 +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.12; Fri, 11 Nov 2022 10:51:43 +0000 Received: from e120703.arm.com (10.2.81.20) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12 via Frontend Transport; Fri, 11 Nov 2022 10:51:43 +0000 MIME-Version: 1.0 To: CC: , , Subject: [PATCH][Binutils, gas] arm: Add support for new unwinder directive ".pacspval". Date: Fri, 11 Nov 2022 10:51:43 +0000 Message-ID: X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT010:EE_|AS4PR08MB7532:EE_|AM7EUR03FT040:EE_|GV1PR08MB8713:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c809db0-4e62-4754-8d86-08dac3d2bff6 X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr 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: Gcgk2HT7CwCbEm6lM8LonL9UWblOWJmvFFHG3r8Z0vdnflp6xjJjiOjwKHFhMuybOTeuIz+rVzD4OrLQLJVujDtBWMjyYTHZdv+bYw5u4VWpAr5UafsiDfGHLIIKGkioaHR8WgH1gwhBy35Rv7PyONzhaeE4/U5neddrFnyzUVscAtk6wUX8PmHoRZM7kWA3nR1N71d65Mqj8nvQcjqW3PyQ14+r8Rjj/E9biH2Pp01aAScQRRWRxDkAcDyzLvbXGaQi59+oICBqVMJL4vrV96utevzjO1knPLYaZ8WA6/cN04WJP4mNwQ7am6XcTYr3/uiRJw6L6bz42wmQi4HfJYAbKq0HmcZQGfaoE94+AJJmn43S2zIHOr4ONMcL9pifGZCODfUeXnnFSR6MyAx96LDtkOd3Po5G5Bl5q2N/mC6izC3kWFttoJH9Jy224BInPKrARc/VIZf+Hq7CITVYtTWd7xfGCqoR1AkYEneR532vy9eqHzyvf4bUZTXbOvZCIQLpmoW2r2lClhQY0hdEfIh20AXkBpajTj+xkTiTuqAajBeLIxJbVtr4AYqQ3xcaPy215rcGxOMEs4CL6sr6I/092BtXpcga10Zd5bBch49uAPwYrqKEwNwkTQpLDrMptUmPOFUo9rIDXKXM4FhId71TnhwMIYbvRvECyjBJ4cg5/mVssUvnURGihC3TFzMVUTI3ewwJEeWovjjHmSo1y0D4Spkixn89zoaOyY7gtoqrfXhJtJzok410aJ/u46cSAlqYTppY/sMNHmKjIRRwfGwinBfcEw99RpL0vf0Ougapd3smPtslx/3a1qnVyvE9 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:(13230022)(4636009)(136003)(396003)(346002)(39860400002)(376002)(451199015)(36840700001)(40470700004)(46966006)(186003)(235185007)(356005)(86362001)(5660300002)(336012)(83380400001)(40460700003)(4326008)(316002)(70586007)(426003)(6916009)(70206006)(8676002)(82310400005)(54906003)(41300700001)(31696002)(47076005)(82740400003)(26005)(33964004)(31686004)(40480700001)(8936002)(478600001)(81166007)(44832011)(36860700001)(2906002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7532 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c8e7e257-f87a-4a30-e747-08dac3d2b908 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gtVbuuNoOI96VRG+30xaBzu4jAX1LPfb2zdJB7AOTCM2WgeqnQar5wEyOMX1SzEZk5HjDpSNGRR8uf3Ybwjr1n535eeO4m2a5CMSURwKBc70jgTw8pED+AuFeseKa+uFf11RdoGvVaA/hxsiZsE+3WcMazXR2eIf7dDJcyD2yrwaO7zSNkFydqUA8x0u3DICtyC4nZjcVUURf01qbLOmGqj2MoIRvNl8WNcuMyb9QvGN+nxWd5yBtDUoxSf8BZxfizGGbpcEdiezE5tGD2fK3FmjCY1Wdbm7KeYur3eFipeTLJTp9j4op8Sx/G4OAXCpybaJlRavq6xRrph+wXideFrNrPbG9hFElMzIIWRnFpIU80fLF07tt1Z2OQZGd/jP+vogzy1bYouHlhv7vS/i2wgHgYSpSmT0wRLEP6O6G88VfxjRamgm8/ucxqWlnkm9RvaknNP5bQKGALWsju+3Bm+peHH+4Al/3M16UDfReUZyOTtkxXbxMgX/2sig63BMM83cd/jSQaTbPCB08O7t9Cp7/8XRefrDMJagK7oCUWGJgS2m/C9VDTsE4eapg5W4KIoDrh/z0rsAkd8JtAx4sjo60H4IfS4p7l8khXeCFqEVBm1rgDrUvNvVFQT29X+Czv8c+soh6fR9D/MCqpbho4Y31r/LchrpJ5ujlXFsSUkuqZdqx4UXSvAJUcBXAWQ4wmVgu2Psu8B9q0WSpfdKYZhFRhO7ZkC/jx+qwH8efbzmd5WvqGPIXTH3wmgA7ZyXvCfu3QynhsgwQ7HYG7CfRQ== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199015)(40470700004)(46966006)(36840700001)(8936002)(44832011)(54906003)(6916009)(186003)(40460700003)(235185007)(426003)(5660300002)(316002)(47076005)(33964004)(41300700001)(2906002)(70586007)(83380400001)(4326008)(70206006)(26005)(8676002)(336012)(81166007)(31686004)(478600001)(82310400005)(40480700001)(31696002)(36860700001)(107886003)(86362001)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2022 10:51:55.6876 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c809db0-4e62-4754-8d86-08dac3d2bff6 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: AM7EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8713 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, 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-Patchwork-Original-From: Srinath Parvathaneni via Binutils From: Srinath Parvathaneni Reply-To: Srinath Parvathaneni Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749196668653278394?= X-GMAIL-MSGID: =?utf-8?q?1749196668653278394?= Hi, This patch adds the assembler support for the new unwinder directive ".pacspval" and encodes this directives with opcode "0xb5". This opcode indicates the unwinder to use effective vsp as modifier for PAC validation. Regression testing for arm-none-eabi target and found no regressions. Ok for binutils-master? Regards, Srinath. gas/ChangeLog: 2022-11-07 Srinath Parvathaneni * doc/c-arm.texi: Document directive. * config/tc-arm.c (s_arm_unwind_pacspval): Define function. (md_pseudo_table): Add entry for pacspval directive. * testsuite/gas/arm/ehabi-pacbti-m.d: New test. * testsuite/gas/arm/ehabi-pacbti-m.s: Likewise. ############### Attachment also inlined for ease of reply ############### diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 0f7d7695c0eb9b2eb5431ca314c54edfed9b633e..c7837195e667a03d3f8f6d16b62c01ac875ee5fd 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -4929,6 +4929,22 @@ s_arm_unwind_pad (int ignored ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } +/* Parse an unwind_pacspval directive. */ + +static void +s_arm_unwind_pacspval (int ignored ATTRIBUTE_UNUSED) +{ + valueT op; + + if (!unwind.proc_start) + as_bad (MISSING_FNSTART); + + demand_empty_rest_of_line (); + + op = 0xb5; + add_unwind_opcode (op, 1); +} + /* Parse an unwind_setfp directive. */ static void @@ -5205,6 +5221,7 @@ const pseudo_typeS md_pseudo_table[] = { "vsave", s_arm_unwind_save, 1 }, { "movsp", s_arm_unwind_movsp, 0 }, { "pad", s_arm_unwind_pad, 0 }, + { "pacspval", s_arm_unwind_pacspval, 0 }, { "setfp", s_arm_unwind_setfp, 0 }, { "unwind_raw", s_arm_unwind_raw, 0 }, { "eabi_attribute", s_arm_eabi_attribute, 0 }, diff --git a/gas/doc/c-arm.texi b/gas/doc/c-arm.texi index 4016d3a76957e545ad8d3f1fad2067b94bb9b83e..8e00ccf55a5c86443e2977c3b8c6f4e6d7ef39d9 100644 --- a/gas/doc/c-arm.texi +++ b/gas/doc/c-arm.texi @@ -1085,6 +1085,12 @@ This directive writes 12-byte packed floating-point values to the output section. These are not compatible with current ARM processors or ABIs. +@anchor{arm_pacspval} +@cindex @code{.pacspval} directive, ARM +@item .pacspval +Generate unwinder annotations to use effective vsp as modifier in PAC +validation. + @anchor{arm_pad} @cindex @code{.pad} directive, ARM @item .pad #@var{count} diff --git a/gas/testsuite/gas/arm/ehabi-pacbti-m.d b/gas/testsuite/gas/arm/ehabi-pacbti-m.d new file mode 100644 index 0000000000000000000000000000000000000000..6039945f931a2975ae4752a5f711e62a00b6ce69 --- /dev/null +++ b/gas/testsuite/gas/arm/ehabi-pacbti-m.d @@ -0,0 +1,15 @@ +# name: Unwind Stack Frame information for Armv8.1-M.Mainline PAC extension +# source: ehabi-pacbti-m.s +# as: -march=armv8.1-m.main+mve+pacbti +# readelf: -u + +Unwind section '.ARM.exidx' at offset 0x5c contains 1 entry: + +0x0: @0x0 + Compact model index: 1 + 0xb1 0x08 pop {r3} + 0x80 0x08 pop {r7} + 0xb4 pop {ra_auth_code} + 0x84 0x00 pop {r14} + 0xb1 0x0f pop {r0, r1, r2, r3} + 0xb5 vsp as modifier for PAC validation diff --git a/gas/testsuite/gas/arm/ehabi-pacbti-m.s b/gas/testsuite/gas/arm/ehabi-pacbti-m.s new file mode 100644 index 0000000000000000000000000000000000000000..10185484c8c9716c394ab0cbe171c626b9847bfc --- /dev/null +++ b/gas/testsuite/gas/arm/ehabi-pacbti-m.s @@ -0,0 +1,38 @@ + .syntax unified + .thumb + .thumb_func + .fnstart + .cfi_startproc + .pacspval + pac ip, lr, sp + .cfi_register 143, 12 + push {r0, r1, r2, r3} + .save {r0, r1, r2, r3} + .cfi_def_cfa_offset 16 + .cfi_offset 0, -16 + .cfi_offset 1, -12 + .cfi_offset 2, -8 + .cfi_offset 3, -4 + push {r3, r7, ip, lr} + .save {r3, r7, ra_auth_code, lr} + .cfi_def_cfa_offset 32 + .cfi_offset 3, -32 + .cfi_offset 7, -28 + .cfi_offset 143, -24 + .cfi_offset 14, -20 + pop {r3, r7, ip, lr} + .cfi_restore 14 + .cfi_restore 143 + .cfi_restore 7 + .cfi_restore 3 + .cfi_def_cfa_offset 0 + add sp, sp, #16 + .cfi_restore 3 + .cfi_restore 2 + .cfi_restore 1 + .cfi_restore 0 + .cfi_def_cfa_offset -16 + aut ip, lr, sp + bx lr + .cfi_endproc + .fnend diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 0f7d7695c0eb9b2eb5431ca314c54edfed9b633e..c7837195e667a03d3f8f6d16b62c01ac875ee5fd 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -4929,6 +4929,22 @@ s_arm_unwind_pad (int ignored ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } +/* Parse an unwind_pacspval directive. */ + +static void +s_arm_unwind_pacspval (int ignored ATTRIBUTE_UNUSED) +{ + valueT op; + + if (!unwind.proc_start) + as_bad (MISSING_FNSTART); + + demand_empty_rest_of_line (); + + op = 0xb5; + add_unwind_opcode (op, 1); +} + /* Parse an unwind_setfp directive. */ static void @@ -5205,6 +5221,7 @@ const pseudo_typeS md_pseudo_table[] = { "vsave", s_arm_unwind_save, 1 }, { "movsp", s_arm_unwind_movsp, 0 }, { "pad", s_arm_unwind_pad, 0 }, + { "pacspval", s_arm_unwind_pacspval, 0 }, { "setfp", s_arm_unwind_setfp, 0 }, { "unwind_raw", s_arm_unwind_raw, 0 }, { "eabi_attribute", s_arm_eabi_attribute, 0 }, diff --git a/gas/doc/c-arm.texi b/gas/doc/c-arm.texi index 4016d3a76957e545ad8d3f1fad2067b94bb9b83e..8e00ccf55a5c86443e2977c3b8c6f4e6d7ef39d9 100644 --- a/gas/doc/c-arm.texi +++ b/gas/doc/c-arm.texi @@ -1085,6 +1085,12 @@ This directive writes 12-byte packed floating-point values to the output section. These are not compatible with current ARM processors or ABIs. +@anchor{arm_pacspval} +@cindex @code{.pacspval} directive, ARM +@item .pacspval +Generate unwinder annotations to use effective vsp as modifier in PAC +validation. + @anchor{arm_pad} @cindex @code{.pad} directive, ARM @item .pad #@var{count} diff --git a/gas/testsuite/gas/arm/ehabi-pacbti-m.d b/gas/testsuite/gas/arm/ehabi-pacbti-m.d new file mode 100644 index 0000000000000000000000000000000000000000..6039945f931a2975ae4752a5f711e62a00b6ce69 --- /dev/null +++ b/gas/testsuite/gas/arm/ehabi-pacbti-m.d @@ -0,0 +1,15 @@ +# name: Unwind Stack Frame information for Armv8.1-M.Mainline PAC extension +# source: ehabi-pacbti-m.s +# as: -march=armv8.1-m.main+mve+pacbti +# readelf: -u + +Unwind section '.ARM.exidx' at offset 0x5c contains 1 entry: + +0x0: @0x0 + Compact model index: 1 + 0xb1 0x08 pop {r3} + 0x80 0x08 pop {r7} + 0xb4 pop {ra_auth_code} + 0x84 0x00 pop {r14} + 0xb1 0x0f pop {r0, r1, r2, r3} + 0xb5 vsp as modifier for PAC validation diff --git a/gas/testsuite/gas/arm/ehabi-pacbti-m.s b/gas/testsuite/gas/arm/ehabi-pacbti-m.s new file mode 100644 index 0000000000000000000000000000000000000000..10185484c8c9716c394ab0cbe171c626b9847bfc --- /dev/null +++ b/gas/testsuite/gas/arm/ehabi-pacbti-m.s @@ -0,0 +1,38 @@ + .syntax unified + .thumb + .thumb_func + .fnstart + .cfi_startproc + .pacspval + pac ip, lr, sp + .cfi_register 143, 12 + push {r0, r1, r2, r3} + .save {r0, r1, r2, r3} + .cfi_def_cfa_offset 16 + .cfi_offset 0, -16 + .cfi_offset 1, -12 + .cfi_offset 2, -8 + .cfi_offset 3, -4 + push {r3, r7, ip, lr} + .save {r3, r7, ra_auth_code, lr} + .cfi_def_cfa_offset 32 + .cfi_offset 3, -32 + .cfi_offset 7, -28 + .cfi_offset 143, -24 + .cfi_offset 14, -20 + pop {r3, r7, ip, lr} + .cfi_restore 14 + .cfi_restore 143 + .cfi_restore 7 + .cfi_restore 3 + .cfi_def_cfa_offset 0 + add sp, sp, #16 + .cfi_restore 3 + .cfi_restore 2 + .cfi_restore 1 + .cfi_restore 0 + .cfi_def_cfa_offset -16 + aut ip, lr, sp + bx lr + .cfi_endproc + .fnend