From patchwork Fri Oct 8 12:18:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejas Belagod X-Patchwork-Id: 1538348 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=wZQDupwE; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HQnQM55cxz9sR4 for ; Fri, 8 Oct 2021 23:22:51 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5ED8C3857805 for ; Fri, 8 Oct 2021 12:22:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5ED8C3857805 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1633695769; bh=C5QJWqiTFQ1lOPNHLZakOUDXFOoNIHLPnd+5jpAl6pw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=wZQDupwEHq6tVdiy/ha0FGKRaA6g1X5ZpH34jP7Ai6r9+dH0tMDZubwCZbkMYXOwn scURZAnhnQy5QdHYchihBOdCAbwVjEXOjsvl/8zgD9eVQgir7GiSzc6icdE1wfFmQu Nw7xlNjasyMoXASi4bbdqPqlfgV95Irjk3D076IA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20078.outbound.protection.outlook.com [40.107.2.78]) by sourceware.org (Postfix) with ESMTPS id 65458385780A for ; Fri, 8 Oct 2021 12:18:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65458385780A Received: from DB6P191CA0022.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::32) by AM6PR08MB3223.eurprd08.prod.outlook.com (2603:10a6:209:4d::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Fri, 8 Oct 2021 12:18:38 +0000 Received: from DB5EUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:28:cafe::64) by DB6P191CA0022.outlook.office365.com (2603:10a6:6:28::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.18 via Frontend Transport; Fri, 8 Oct 2021 12:18:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT057.mail.protection.outlook.com (10.152.20.235) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 12:18:38 +0000 Received: ("Tessian outbound e27daf245730:v103"); Fri, 08 Oct 2021 12:18:38 +0000 X-CR-MTA-TID: 64aa7808 Received: from d39f3d13dc8b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4E626CC3-0595-4DCF-B047-6F07A72A1F90.1; Fri, 08 Oct 2021 12:18:32 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d39f3d13dc8b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 08 Oct 2021 12:18:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j7jU7D/+kuybfROORpxDOaZIvKDV1UWUqpBgElSl6TATt4b4QfkBS8vTuLe5YyRAiNPKEH0U7veydkxWfpWd8lr9dyn3xC9CHSdqrqpCjVFhP2ODsSl2HE8uIPGfw0Ps3Ok0e1FQ+qwXkz5/GaFHIAyzGa9QPUnu0Dgyfzno4Ru72R9OId5R8Z2v27I1nBr/c8QN1HO6g4QhSnW2lAYyjIxRg3kUTGlG2qmkDAB2r+pzhvrjhbVW1abHbY8h/gREsQxF7IH8K8qjAegFz/t3BH/lsOQJsODEyNSzXojQVw+xxNoWgWVnryk520kp6x8FkcN6TV4jihbwH1kM8Qsmhg== 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=C5QJWqiTFQ1lOPNHLZakOUDXFOoNIHLPnd+5jpAl6pw=; b=ZnmHdM1E0OpGOQcK+lKPmsi+lIFEo8W3CVjP2/v9OUCgkfNLFJlRREQm11+6xvc+MIx62iKO05X2+m/H1+45NFI79CdkrqAnvRmahZC8YczDIaKRH4otl+3eqA5XO+ef0gtkfuaCxcYyQcX/Rs+wElx1Pis8gdsnfQkSmjLiV1Q+V+Wp0MCCCjXsIOms021skAlNara0cfme+jIDwakEFL8fmSlStkjVwIinsxA1TVYIVlMs7NsgdVXjGPIWNWGyl0h2kstJWJnQiAk7RgdCituXrjFPFmjAF8ciUTqACH+kFu+giku18uzJt2Q2khEjcRzIteYXqud9kI3W47WKeg== 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 Received: from AM5PR0801MB1844.eurprd08.prod.outlook.com (2603:10a6:203:39::22) by AM6PR08MB3864.eurprd08.prod.outlook.com (2603:10a6:20b:8e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.22; Fri, 8 Oct 2021 12:18:28 +0000 Received: from AM5PR0801MB1844.eurprd08.prod.outlook.com ([fe80::4cab:e095:5105:b6ec]) by AM5PR0801MB1844.eurprd08.prod.outlook.com ([fe80::4cab:e095:5105:b6ec%9]) with mapi id 15.20.4566.022; Fri, 8 Oct 2021 12:18:28 +0000 To: "gcc-patches@gcc.gnu.org" Subject: [Patch 5/7, Arm. GCC] Add pointer authentication for stack-unwinding runtime. Thread-Topic: [Patch 5/7, Arm. GCC] Add pointer authentication for stack-unwinding runtime. Thread-Index: Ade8O/4YoShuODbFSk6VRITfMftxSA== Date: Fri, 8 Oct 2021 12:18:28 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-ts-tracking-id: 4B828C8F9D3BEB438089A556101BA738.0 x-checkrecipientchecked: true Authentication-Results-Original: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 90e57030-a2ba-4cb5-bcf5-08d98a55c1fb x-ms-traffictypediagnostic: AM6PR08MB3864:|AM6PR08MB3223: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:4941;OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: adddnA7OeFoy3TYA2P9OQ8f+yRacLuN655EKwn7E3j6lk3r/FEdLW1tPf0EBF+hqeBCUVBN6x5lk7WI1Y21mDPq8FvRp9j9/qmE8eQaoKq+9N4UfBlC1m8U88+t5XoPl9JvpKQeI4PM7OP5UHgpdkwTRm218roJEnugsnOBd97pMGcq1iiPb6cHK2WkF/e5PI9LlXcqG0EQYygzS3PxiZhsdlVwqq9d39vDyRIwclJp8xlAM304cA/f87IZbFkBXfaas9Iq8Xlzhk96rSbJWhK3ZJq0LBEE2+0C34e16e1+bEIRgPcEokNW01Z69bvW4rZcsILWIMf5XPPtveQiuyE3eT45jkk/txrqiDry3Z88+M6uvdE3Cn7eUcraiUwWhGac+kWaF8sqZkSW07sSsoia2FOGD1H18XpB14g1kOVafJY+l+IsrFW+DRoj8vXry+pE06YBtPPB5xvIFcq9YhKogUEk/5qZvYfvDiAP1H6xlvGG7PB2zauN6npoc5DvPd58G8pZycH2WEhkhhe9hFwdq1sVwjgkEwbdeWRFJpPL/yK6X56iwrbXHMOTAjCQw5Ta2KJeamtV+c0RvrYrapsKHxmzB+TgQ/JlDDJ8ln0bVLNF4Ua2ijgzZyxt5Zw6kJ2d5tTnKm3l6t/wX2xHG5C+Y1Uwp0LQfRPCbBtxLt30WzPvD0DpmEwRJsbqtqp+MiJ/h2WLt443zALTyFT99iw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM5PR0801MB1844.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(76116006)(86362001)(8936002)(6506007)(38100700002)(122000001)(71200400001)(38070700005)(66476007)(5660300002)(33656002)(26005)(9686003)(508600001)(316002)(8676002)(66556008)(2906002)(55016002)(52536014)(7696005)(66946007)(6916009)(83380400001)(186003)(99936003)(64756008)(66446008); DIR:OUT; SFP:1101; x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3864 Original-Authentication-Results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: c7caeac2-e338-4b7b-67eb-08d98a55bc16 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ooqp96oHA2rqAKydRzPEvgCTziM7g/TY48YY3q8pq4EcwWWRQ6nV/k+r/mm2Wkp4MCouLnseZxCM4QntP8/Dg2hIbvCTCBzqMe/BzUM8YTrElJTTvBKKiTVS0d1wr6igrP6JigJo4x6U/bKuvKzV3Ibchgv2xdkIVKbxPKTDQmRV5CzE5CgvsSVBM3/tZxmxddxNJf9S8YlmYstdqlEeHuaKtExKpz68uXFLgzS3XIpXzPvbNUZA0U/G6jfVGLO3sAzUVWoyoK4q0AIdPAj4FEhje3yDp+HbMQTcCnSOK0EEltkEhWtmbmYN69IF4tFZopjuBHfwM7hZpew/hRhGuuXG7qVmW0m/RBjhqM+uLdrjSC1zW+s57KHjuiczXmVm+CRRns6JiLloXr4KT5ke9MilSb+N8SpC5UjqxsjRPlidyYtZzRO90Ixjg7rdXii0GTYopgy/aNqgDsEFLezmjZHJ2nuuOOkqL7FS0tFHyVgemgCkgvChza4m+y0cpsL4rPrY42qEXi8CRw3UjTzT5bPwnTAXTw79dXew8WLcJrAlZRSIRBvy9H3VAF+YfTaJoULQjZBuFg9KjcbMiGcy9/Z3TxrqyY/9aLNRqsE2Nvaa7K5cnOhrfDamrKYjb6uhQeY/A3oa4ldpKHp7y/HR3tYvXVRGzFUJRYCS6mzJApOcBhMYO8IylQPV0Q1IYML0tVoMx2mMwHa1EtMAq4L2/g== 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:(4636009)(36840700001)(46966006)(26005)(2906002)(316002)(52536014)(83380400001)(70206006)(186003)(99936003)(81166007)(6506007)(70586007)(8936002)(235185007)(21480400003)(82310400003)(5660300002)(55016002)(47076005)(8676002)(86362001)(36860700001)(7696005)(33656002)(6916009)(9686003)(336012)(356005)(508600001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2021 12:18:38.0899 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 90e57030-a2ba-4cb5-bcf5-08d98a55c1fb 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: DB5EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3223 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tejas Belagod via Gcc-patches From: Tejas Belagod Reply-To: Tejas Belagod Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch adds authentication for when the stack is unwound when an exception is taken. All the changes here are done to the runtime code in libgcc's unwinder code for Arm target. All the changes are guarded under defined (__ARM_FEATURE_PAC_DEFAULT) and activates only if the +pacbti feature is switched on for the architecture. This means that switching on the target feature via -march or -mcpu is sufficient and -mbranch-protection need not be enabled. This ensures that the unwinder is authenticated only if the PACBTI instructions are available in the non-NOP space as it uses AUTG. Just generating PAC/AUT instructions using -mbranch-protection will not enable authentication on the unwinder. Tested on arm-none-eabi. OK for trunk? 2021-10-04 Tejas Belagod gcc/ChangeLog: * ginclude/unwind-arm-common.h (_Unwind_VRS_RegClass): Introduce new pseudo register class _UVRSC_PAC. * libgcc/config/arm/pr-support.c (__gnu_unwind_execute): Decode exception opcode (0xb4) for saving RA_AUTH_CODE and authenticate with AUTG if found. * libgcc/config/arm/unwind-arm.c (struct pseudo_regs): New. (phase1_vrs): Introduce new field to store pseudo-reg state. (phase2_vrs): Likewise. (_Unwind_VRS_Get): Load pseudo register state from virtual reg set. (_Unwind_VRS_Set): Store pseudo register state to virtual reg set. (_Unwind_VRS_Pop): Load pseudo register value from stack into VRS. diff --git a/gcc/ginclude/unwind-arm-common.h b/gcc/ginclude/unwind-arm-common.h index 79f107d8abb2dd1e2d4903531db47147da63fee8..903c0d22e4a7bf41d806842e030a4ad532fb835f 100644 --- a/gcc/ginclude/unwind-arm-common.h +++ b/gcc/ginclude/unwind-arm-common.h @@ -127,7 +127,10 @@ extern "C" { _UVRSC_VFP = 1, /* vfp */ _UVRSC_FPA = 2, /* fpa */ _UVRSC_WMMXD = 3, /* Intel WMMX data register */ - _UVRSC_WMMXC = 4 /* Intel WMMX control register */ + _UVRSC_WMMXC = 4, /* Intel WMMX control register */ +#if defined(__ARM_FEATURE_PAC_DEFAULT) + _UVRSC_PAC = 5 /* Armv8.1-M Mainline PAC/AUTH pseudo-register */ +#endif } _Unwind_VRS_RegClass; diff --git a/libgcc/config/arm/pr-support.c b/libgcc/config/arm/pr-support.c index 7525e35b4918d38b4ab3ae73a69b722e31b4b322..ff45f3c6e08a8df64011c0e3a5f5dd1677b3ed11 100644 --- a/libgcc/config/arm/pr-support.c +++ b/libgcc/config/arm/pr-support.c @@ -106,6 +106,9 @@ __gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws) { _uw op; int set_pc; +#if defined(__ARM_FEATURE_PAC_DEFAULT) + int set_pac = 0; +#endif _uw reg; set_pc = 0; @@ -114,6 +117,22 @@ __gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws) op = next_unwind_byte (uws); if (op == CODE_FINISH) { +#if defined(__ARM_FEATURE_PAC_DEFAULT) + /* When we reach end, we have to authenticate R12 we just popped earlier. */ + if (set_pac) + { + _uw sp; + _uw lr; + _uw pac; + _Unwind_VRS_Get (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, &sp); + _Unwind_VRS_Get (context, _UVRSC_CORE, R_LR, _UVRSD_UINT32, &lr); + _Unwind_VRS_Get (context, _UVRSC_PAC, R_IP, + _UVRSD_UINT32, &pac); + __asm__ __volatile__ + ("autg %0, %1, %2" : : "r"(pac), "r"(lr), "r"(sp) :); + } +#endif + /* If we haven't already set pc then copy it from lr. */ if (!set_pc) { @@ -227,6 +246,19 @@ __gnu_unwind_execute (_Unwind_Context * context, __gnu_unwind_state * uws) return _URC_FAILURE; continue; } +#if defined(__ARM_FEATURE_PAC_DEFAULT) + /* Pop PAC off the stack into VRS pseudo.pac. */ + if (op == 0xb4) + { + if (_Unwind_VRS_Pop (context, _UVRSC_PAC, 0, _UVRSD_UINT32) + != _UVRSR_OK) + return _URC_FAILURE; + set_pac = 1; + continue; + } + +#endif + if ((op & 0xfc) == 0xb4) /* Obsolete FPA. */ return _URC_FAILURE; diff --git a/libgcc/config/arm/unwind-arm.c b/libgcc/config/arm/unwind-arm.c index d0394019c3649f2f6d6a2882389e55b56c21b8ef..6e6eb808d70dd1f6d68ec3c5bf0cd3978cc1166b 100644 --- a/libgcc/config/arm/unwind-arm.c +++ b/libgcc/config/arm/unwind-arm.c @@ -64,6 +64,14 @@ struct wmmxc_regs _uw wc[4]; }; +#if defined(__ARM_FEATURE_PAC_DEFAULT) +/* Holds value of pseudo registers eg. PAC. */ +struct pseudo_regs +{ + _uw pac; +}; +#endif + /* The ABI specifies that the unwind routines may only use core registers, except when actually manipulating coprocessor state. This allows us to write one implementation that works on all platforms by @@ -78,6 +86,11 @@ typedef struct /* The first fields must be the same as a phase2_vrs. */ _uw demand_save_flags; struct core_regs core; +#if defined(__ARM_FEATURE_PAC_DEFAULT) + /* Armv8.1-M Mainline PAC/AUTH values. This field should be in the same field + order as phase2_vrs. */ + struct pseudo_regs pseudo; +#endif _uw prev_sp; /* Only valid during forced unwinding. */ struct vfp_regs vfp; struct vfpv3_regs vfp_regs_16_to_31; @@ -99,6 +112,9 @@ typedef struct { _uw demand_save_flags; struct core_regs core; +#if defined(__ARM_FEATURE_PAC_DEFAULT) + struct pseudo_regs pac; +#endif } phase2_vrs; /* Coprocessor register state manipulation functions. */ @@ -175,6 +191,12 @@ _Unwind_VRS_Result _Unwind_VRS_Get (_Unwind_Context *context, case _UVRSC_WMMXC: return _UVRSR_NOT_IMPLEMENTED; +#if defined(__ARM_FEATURE_PAC_DEFAULT) + case _UVRSC_PAC: + *(_uw *) valuep = vrs->pseudo.pac; + return _UVRSR_OK; +#endif + default: return _UVRSR_FAILED; } @@ -206,6 +228,12 @@ _Unwind_VRS_Result _Unwind_VRS_Set (_Unwind_Context *context, case _UVRSC_WMMXC: return _UVRSR_NOT_IMPLEMENTED; +#if defined(__ARM_FEATURE_PAC_DEFAULT) + case _UVRSC_PAC: + vrs->pseudo.pac = *(_uw *) valuep; + return _UVRSR_OK; +#endif + default: return _UVRSR_FAILED; } @@ -246,6 +274,16 @@ _Unwind_VRS_Result _Unwind_VRS_Pop (_Unwind_Context *context, } return _UVRSR_OK; +#if defined(__ARM_FEATURE_PAC_DEFAULT) + case _UVRSC_PAC: + { + if (discriminator != 0) + return _UVRSR_FAILED; + vrs->pseudo.pac = *(_uw *) vrs->core.r[R_SP]; + return _UVRSR_OK; + } +#endif + case _UVRSC_VFP: { _uw start = discriminator >> 16;