From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2059.outbound.protection.outlook.com [40.107.22.59]) by sourceware.org (Postfix) with ESMTPS id 018A63858010 for ; Wed, 4 May 2022 10:42:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 018A63858010 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Bm7XAuhBSOeCm3sGNqrKPHw7ahqBO+yrH9MsXyn0ZEn3b4lhdRwgQWxJcGMBIBfHGrioASKxCydkVA5tX9JxetoZK50NVn1sB535qd6nCLJaF5GGrouj0+GKyMwAL6X+hXAesdUQCz2Pt8wHzPz1zsg5mbZf0iBs5IlLftm06CVesWh+FmgVCmvQ2H9tOwXW+cpeDJHcEMyFmoPaaWQRuqe3oySallhYNuKC6YkPz5H2J9PoRYahrA0mZIEqSO5QSwwt1iX6OxBSbWnY7c5bvzM5I2es5XPlxTsAUxDS9VJLnd8eQ4kTgSvgUqJJv1PZwBET3Ry2SWkUrp2D6U+thw== 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=EXZg3kD4csOihKTc4ynTk205/jRtkaQgZRPBeT3SGug=; b=U2KHe4rGY3oLZ+cVa5+ezpVAXwdPf75I1cSuti8Tmsb6/BamL7SCTgEugZyWetUXGgxOgWU7Jz1pvRpCjnkOuHSCwXQCTo0CuUMQ8nODL1mn9XyHEus98iuSi1ByKZ0jeWFjcfEKoJ03H+X6XQ+F/ZnPW6WCd5PkjZwF/6cUAbZ2hoIRZPc5Wd6X180fH3HCY3aVMCRB9e2dql2NDjIoQ/PVykbJsHJCFrfyXEXrRyo5zlyAyGo5H55cXJ1ejVbG4fgKhoZGL2sndF6rxlZFQFdWxj040JyQtzosQDtmlyYhQAJKaFPUZIzsrUxnZjQy+cZHBd5EQ6zzCVs6uO59Mw== 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 DB6PR07CA0064.eurprd07.prod.outlook.com (2603:10a6:6:2a::26) by AM6PR08MB4008.eurprd08.prod.outlook.com (2603:10a6:20b:ae::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Wed, 4 May 2022 10:42:34 +0000 Received: from DB5EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2a:cafe::64) by DB6PR07CA0064.outlook.office365.com (2603:10a6:6:2a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.16 via Frontend Transport; Wed, 4 May 2022 10:42:34 +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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT031.mail.protection.outlook.com (10.152.20.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.15 via Frontend Transport; Wed, 4 May 2022 10:42:34 +0000 Received: ("Tessian outbound 2d401af10eb3:v118"); Wed, 04 May 2022 10:42:34 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 75f3859df17faa79 X-CR-MTA-TID: 64aa7808 Received: from b1bc8696ab37.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 61920902-8C51-4106-874F-DD93DA6977C2.1; Wed, 04 May 2022 10:42:27 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b1bc8696ab37.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 04 May 2022 10:42:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IYygafeT2ydVi7uCszs3GvR6ERhcKBmuca638TD8KdSEHrBbh4u8Dmat59CCLdUWz8U8FF4Mk4KMib370D8iwVaCWVUN6m3CLhm6bzaZ7A5qAeoZMI2zxTkoOMn+O6SaWvKcsnnBtvjPXCgvl4ePpgbN3RylLxektnCvAL+j3hgxaq+rUmlQD1t6ComubDnQEAeSXux9ujYSzrQIx6JVWXo+ig+fSip+6854EsxPJmzXTEsvZQWG+QxbNd7Pbnt6PT2E4lZeLI9TavYHv7aRl9KntYX8EammQFv7q//5ZSVxm3noKW0qdL0F++WEOhlvw5/9d3DLy0xSlMfoJVPArQ== 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=EXZg3kD4csOihKTc4ynTk205/jRtkaQgZRPBeT3SGug=; b=clX+CH3yrDzBwm1/SbavhYY3iBIq1CpctpGm2fTiGdhdoxDONMn1bOsSlVhf9y4053/aQGPlDBwK0aUOoq0qmYRnFSsQjOslG8y300cHd2QMWbh46z2D3NFwHB4WJ6pId73FcFEXc4UwsxPvNFq1dJwhBgy8tcld7Ut2Inzi2IrV7r+KBu58OLvqeqHvYziYMq659ZkXuDiqFn5iHTVGl4CKFoGKTrH9KDoS4Um4AUdnXnkmeEDVoIU94IcGs3DwcNdi3fw1OcvEZIQz0LQhkprsV/ZJOy7RGa8jkvo1pcQPVgm3OXywnvDaEjCHtZAqKbjkEh5YW1mj6s51kG5CSQ== 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 AS9PR04CA0112.eurprd04.prod.outlook.com (2603:10a6:20b:531::13) by VI1PR08MB4176.eurprd08.prod.outlook.com (2603:10a6:803:ec::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.25; Wed, 4 May 2022 10:42:15 +0000 Received: from VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:531:cafe::50) by AS9PR04CA0112.outlook.office365.com (2603:10a6:20b:531::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.25 via Frontend Transport; Wed, 4 May 2022 10:42:15 +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; Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT014.mail.protection.outlook.com (10.152.19.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Wed, 4 May 2022 10:42:15 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.27; Wed, 4 May 2022 10:42:10 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.27; Wed, 4 May 2022 10:42:06 +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.2308.27 via Frontend Transport; Wed, 4 May 2022 10:42:10 +0000 From: Victor Do Nascimento To: Subject: [PATCH][Binutils][GAS] arm: Add unwind support for mixed register lists Date: Wed, 4 May 2022 11:41:46 +0100 Message-ID: <20220504104146.39363-1-victor.donascimento@arm.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: a06c5a05-f1bc-40e3-d531-08da2dbacc62 X-MS-TrafficTypeDiagnostic: VI1PR08MB4176:EE_|DB5EUR03FT031:EE_|AM6PR08MB4008:EE_ X-Microsoft-Antispam-PRVS: 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: feOdQJ3vCplaJb5L05DFgGLZraslSQOhaOLruOi3lI6s2MoywjI8vXTF9MhkpHs5LbCAIORKBUpdjKWCbnP6FWWE87YhGb/Swq5JbOEuKZIrGCd64tKDvkU1FjPO/ftiBJXVqkyb7O8FXYV1v/WYtvVV1hGNZrN+9jnHMeVpeKWOmuHnRYgZR9vqKoU7skrhB1ZdNcExFjdH+1s2RlliqFYZYebC+1iuVHF+y6hEBCjgkqjExtbrFiszlvNe+ZYe9nV3oCW6ojh4TWFBR/marYu8aXECd1eMUK/jfFxf1LV5XrDanGP82ChaY8g66pe5UW3zgMOSd+GFptzjXUF7Yu+2+KyoTVQmuxGLP5cuDZbzcwhxf5hBxT/tu77L6dbez3uulrOogAnnTCa+3BFyqm3yOvTAsAz+bom6zESoGoB3/zo58G2gTwoPWMu0MPKywRFifDk7Db74DhWND7W1oNyLXGcoYImu7PO1naE8TqwShdD1vw3DYPvJkYUTVCOreeNZIHJJ6PIop1IBUxnRPO3dpxysx+HjWdVKqQp+ZjVG4XZZeSJMu1rNWSvVmED7fm0DkK7kFUrPYaRi7hxCV0bdPYeo5mfca11TqaqY4iGvTzmOfe/fQNV4M9qVlEFd1X5ZQTZMdfcoZDj91DVjbtuOEb9wYZXkboMgYpo9l5lFduMlp5sQeLoGnQZIvpFG8p+wx4RyxAYYnYwdMIoI8w== 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:(13230001)(4636009)(40470700004)(46966006)(36840700001)(508600001)(5660300002)(36860700001)(83380400001)(82310400005)(8936002)(2906002)(36756003)(6916009)(316002)(8676002)(4326008)(70206006)(70586007)(6666004)(7696005)(2616005)(1076003)(186003)(26005)(336012)(47076005)(426003)(40460700003)(86362001)(356005)(81166007)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4176 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b6aba4d8-43e5-4c7e-f849-08da2dbac10c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sGtL1r97oV+H+2h2R5U1jg6DjE88y+4Sz44nTbgset/zePnmzhsH/lmudS/46n+P8ZLCrlKogh5RCPb+p7xih1eZ8aAwsCuzj2HMQaCq/X25xXcK4cNm1HY3nGO66rpYryhwjDtkZ5loVcJDzlsPCTpiPuENVOZCoq3lPc8U94LJcrCgaRJQuS6tCCElPeOqchsJMSxQh5AKFzHhoYzYDVNGF6cRt+Yh6MPgLHYZaCdQtmIw+bh+8aIW0ux+lQ//KPKRr576oo1SgQHNSm9eBZG2P1KizmLFqe1LMOYumi0zGmKGzgZveXaIzy57gLCSNkqcuQBLJSwbwJNPHP4jVFfprlqVXKeIBy3nWqArylltT02zY+e+SmL8QR5LhfvRPo9nGuO/+i8S84KAuLQglBr5pBXBm38HMpKRGCVjb9Xd3zdUuH0n88ikzHpuz3yBspSrtGv2Eg8l4ujkBQ6s2RQJu/98LwPLHsK4AqnmYHA556/nMTN7cq6CSavkvGZ4jEtc/JswIqh8XyYrYnMnBK+HEZHtyuEV/pX8bikGLyIwvYpwlmmkst8bq1yYJmdxWaHuX01EZM2ZfmfWUfaAdqK1x3WeFFel+RssZDJMMShZ7NxsfUGaHtJIpfcZ+9BcmOGm04+FiOfIuCw4Wya1LE6sT9/8G6s1ZvRaz0mEh3Xz8SQd+OviuTo5syPGh2qA 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:(13230001)(4636009)(40470700004)(46966006)(36840700001)(2906002)(82310400005)(8936002)(36756003)(81166007)(316002)(36860700001)(70586007)(70206006)(4326008)(8676002)(6916009)(1076003)(2616005)(508600001)(426003)(186003)(47076005)(336012)(83380400001)(26005)(40460700003)(5660300002)(6666004)(86362001)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2022 10:42:34.2457 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a06c5a05-f1bc-40e3-d531-08da2dbacc62 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: DB5EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4008 X-Spam-Status: No, score=-13.9 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, T_SCC_BODY_TEXT_LINE, 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: 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: Wed, 04 May 2022 10:42:40 -0000 Hi, This patch extends support for the encoding of the Return Address Authentication pseudo-register in lists containing other register types - e.g. '.save {r4,ra_auth_code,lr}'. Lists are broken down into sub-lists allowing assembler to emit the correct new pacbti unwind opcode for the RA_AUTH_CODE pseudo register. Tested for arm-none-eabi. Thanks, Victor. gas/Changelog: * testsuite/gas/arm/unwind-pacbti-m.s: Expand test for mixed register type lists. * testsuite/gas/arm/unwind-pacbti-m.d: Likewise. * testsuite/gas/arm/unwind-pacbti-m-readelf.d: Likewise. * config/tc-arm.c (parse_reg_list): Add handling of mixed register types. (reg_names): Enumerate pseudoregister according to mapped physical register number. (s_arm_unwind_save_pseudo): Modify function signature. (s_arm_unwind_save_core): Likewise. (s_arm_unwind_save_mixed): New function. (s_arm_unwind_save): Generate register list mask to pass to nested functions. --- gas/config/tc-arm.c | 117 +++++++++++++----- .../gas/arm/unwind-pacbti-m-readelf.d | 12 +- gas/testsuite/gas/arm/unwind-pacbti-m.d | 14 ++- gas/testsuite/gas/arm/unwind-pacbti-m.s | 6 + 4 files changed, 107 insertions(+), 42 deletions(-) diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index ca4f97b164ae8b0196e1830dc49e4927f8ea2480..8873269d76a482352c69d2d40a248549e7d6ba90 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -1942,6 +1942,22 @@ parse_reg_list (char ** strp, enum reg_list_els etype) rt = REG_TYPE_PSEUDO; reg = arm_reg_parse (&str, rt); + + /* Skip over allowed registers of alternative types in mixed-type + register lists. */ + if (reg == FAIL && rt == REG_TYPE_PSEUDO + && ((reg = arm_reg_parse (&str, REG_TYPE_RN)) != FAIL)) + { + cur_reg = reg; + continue; + } + else if (reg == FAIL && rt == REG_TYPE_RN + && ((reg = arm_reg_parse (&str, REG_TYPE_PSEUDO)) != FAIL)) + { + cur_reg = reg; + continue; + } + if (etype == REGLIST_CLRM) { if (reg == REG_SP || reg == REG_PC) @@ -4281,22 +4297,11 @@ s_arm_unwind_personality (int ignored ATTRIBUTE_UNUSED) /* Parse a directive saving pseudo registers. */ static void -s_arm_unwind_save_pseudo (void) +s_arm_unwind_save_pseudo (long range) { valueT op; - long range; - - range = parse_reg_list (&input_line_pointer, REGLIST_PSEUDO); - if (range == FAIL) - { - as_bad (_("expected pseudo register list")); - ignore_rest_of_line (); - return; - } - - demand_empty_rest_of_line (); - if (range & (1 << 9)) + if (range & (1 << 12)) { /* Opcode for restoring RA_AUTH_CODE. */ op = 0xb4; @@ -4308,22 +4313,11 @@ s_arm_unwind_save_pseudo (void) /* Parse a directive saving core registers. */ static void -s_arm_unwind_save_core (void) +s_arm_unwind_save_core (long range) { valueT op; - long range; int n; - range = parse_reg_list (&input_line_pointer, REGLIST_RN); - if (range == FAIL) - { - as_bad (_("expected register list")); - ignore_rest_of_line (); - return; - } - - demand_empty_rest_of_line (); - /* Turn .unwind_movsp ip followed by .unwind_save {..., ip, ...} into .unwind_save {..., sp...}. We aren't bothered about the value of ip because it is clobbered by calls. */ @@ -4722,6 +4716,40 @@ s_arm_unwind_save_mmxwcg (void) ignore_rest_of_line (); } +static void +s_arm_unwind_save_mixed (long range, long mask_range) +{ + const long roof = ((sizeof (long) * CHAR_BIT) - 1) + - __builtin_clzl (mask_range); + + long subrange = 0; + unsigned lim_lo = 0; + unsigned lim_hi = 0; + + /* Iterate over pseudoregister to establish subrange bounds. */ + for (; lim_hi <= roof; lim_hi++) + { + if (mask_range & (1 << lim_hi)) + { + /* Once we know where to split our range, construct subrange. */ + for (unsigned n = lim_lo; n < lim_hi; n++) + { + if (range & (1 << n)) + subrange |= (1 << n); + } + + s_arm_unwind_save_core (subrange); + s_arm_unwind_save_pseudo (1 << lim_hi); + + subrange = 0; + lim_lo = lim_hi + 1; + } + } + + lim_lo = 0xffff << roof; + subrange = range & lim_lo; + s_arm_unwind_save_core (subrange); +} /* Parse an unwind_save directive. If the argument is non-zero, this is a .vsave directive. */ @@ -4729,7 +4757,8 @@ s_arm_unwind_save_mmxwcg (void) static void s_arm_unwind_save (int arch_v6) { - char *peek; + char *peek, *mask_peek; + long range, mask_range; struct reg_entry *reg; bool had_brace = false; @@ -4737,7 +4766,7 @@ s_arm_unwind_save (int arch_v6) as_bad (MISSING_FNSTART); /* Figure out what sort of save we have. */ - peek = input_line_pointer; + peek = mask_peek = input_line_pointer; if (*peek == '{') { @@ -4767,13 +4796,35 @@ s_arm_unwind_save (int arch_v6) s_arm_unwind_save_fpa (reg->number); return; + case REG_TYPE_PSEUDO: case REG_TYPE_RN: - s_arm_unwind_save_core (); - return; + mask_range = parse_reg_list (&mask_peek, REGLIST_PSEUDO); + range = parse_reg_list (&input_line_pointer, REGLIST_RN); - case REG_TYPE_PSEUDO: - s_arm_unwind_save_pseudo (); - return; + if (range == FAIL || mask_range == FAIL) + { + as_bad (_("expected register list")); + ignore_rest_of_line (); + return; + } + + demand_empty_rest_of_line (); + + if (!mask_range) + { + s_arm_unwind_save_core (range); + return; + } + else if (!range) + { + s_arm_unwind_save_pseudo (mask_range); + return; + } + else + { + s_arm_unwind_save_mixed (range, mask_range); + return; + } case REG_TYPE_VFD: if (arch_v6) @@ -23976,7 +24027,7 @@ static const struct reg_entry reg_names[] = for tc_arm_regname_to_dw2regnum to translate to DWARF reg number using 134 + reg_number should the range 134 to 142 be used for more pseudo regs in the future. This also helps fit RA_AUTH_CODE into a bitmask. */ - REGDEF(ra_auth_code,9,PSEUDO), + REGDEF(ra_auth_code,12,PSEUDO), }; #undef REGDEF #undef REGNUM diff --git a/gas/testsuite/gas/arm/unwind-pacbti-m-readelf.d b/gas/testsuite/gas/arm/unwind-pacbti-m-readelf.d index ba1d76dd18fbe0ca2c391c12ddcb180d1de3b32b..d8d647bb7f0d943ceeec47e2f4fc8d34bb0ea057 100644 --- a/gas/testsuite/gas/arm/unwind-pacbti-m-readelf.d +++ b/gas/testsuite/gas/arm/unwind-pacbti-m-readelf.d @@ -6,11 +6,15 @@ # VxWorks needs a special variant of this file. #skip: *-*-vxworks* -Unwind section '.ARM.exidx' at offset 0x40 contains 1 entry: +Unwind section '.ARM.exidx' at offset 0x60 contains 1 entry: -0x0 : 0x80b4a8b0 - Compact model index: 0 +0x0 : @0x0 + Compact model index: 1 + 0x84 0x00 pop {r14} + 0xb4 pop {ra_auth_code} + 0x84 0x00 pop {r14} + 0xb4 pop {ra_auth_code} + 0xa3 pop {r4, r5, r6, r7} 0xb4 pop {ra_auth_code} 0xa8 pop {r4, r14} 0xb0 finish - diff --git a/gas/testsuite/gas/arm/unwind-pacbti-m.d b/gas/testsuite/gas/arm/unwind-pacbti-m.d index 28021758a7487097689ef4c44cc25546ccac5221..06cb3145e4254b34c2d95616d7ea20506af3a42a 100644 --- a/gas/testsuite/gas/arm/unwind-pacbti-m.d +++ b/gas/testsuite/gas/arm/unwind-pacbti-m.d @@ -8,16 +8,20 @@ .*: file format.* RELOCATION RECORDS FOR \[.ARM.exidx\]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE. 00000000 R_ARM_PREL31 .text -00000000 R_ARM_NONE __aeabi_unwind_cpp_pr0 +00000000 R_ARM_NONE __aeabi_unwind_cpp_pr1 +00000004 R_ARM_PREL31 .ARM.extab Contents of section .text: - 0000 (10b54df8 04cd5df8 04cb10bd|b510f84d cd04f85d cb04bd10) .* + 0000 (10b54df8 04cd5df8 04cb2de9 f050bde8|e8bd50f0 e92dcb04 f85dcd04 f84db510) .* + 0010 (f0502de9 0050bde8 005010bd|bd105000 e8bd5000 e92d50f0) .* +Contents of section .ARM.extab: + 0000 (00840281 b40084b4 b0a8b4a3|a3b4a8b0 b48400b4 81028400) 00000000 .* Contents of section .ARM.exidx: - 0000 00000000 (b0a8b480|80b4a8b0) .* + 0000 00000000 00000000 .* Contents of section .ARM.attributes: 0000 41(290000 00|000000 29)616561 62690001 (1f000000|0000001f) .* 0010 05382e31 2d4d2e4d 41494e00 0615074d .* - 0020 09033202 34024a01 4c01 .* + 0020 09033202 34024a01 4c01 .* diff --git a/gas/testsuite/gas/arm/unwind-pacbti-m.s b/gas/testsuite/gas/arm/unwind-pacbti-m.s index 5a6ea2eec2b8e48dd49963f0a4b93fa29c3c3a49..37202293133e95f7e94490aaa1729afb30a0afe7 100644 --- a/gas/testsuite/gas/arm/unwind-pacbti-m.s +++ b/gas/testsuite/gas/arm/unwind-pacbti-m.s @@ -16,5 +16,11 @@ foo: push {r12} .save {ra_auth_code} pop {r12} + push {r4-r7, ip, lr} + .save {r4-r7, ra_auth_code, lr} + pop {r4-r7, ip, lr} + push {ip, lr} + .save {ra_auth_code, lr} + pop {ip, lr} pop {r4, pc} .fnend -- 2.17.1