Message ID | LO4P265MB591487CCBB57E75FE05F23AF80C2A@LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM |
---|---|
State | New |
Headers |
Return-Path: <binutils-bounces+patchwork=sourceware.org@sourceware.org> 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 5739C38618A1 for <patchwork@sourceware.org>; Wed, 27 Sep 2023 12:43:18 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx07-00376f01.pphosted.com (mx07-00376f01.pphosted.com [185.132.180.163]) by sourceware.org (Postfix) with ESMTPS id A21883858D33 for <binutils@sourceware.org>; Wed, 27 Sep 2023 12:43:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A21883858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=imgtec.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=imgtec.com Received: from pps.filterd (m0168889.ppops.net [127.0.0.1]) by mx07-00376f01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38R5j298001581; Wed, 27 Sep 2023 13:42:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imgtec.com; h= from:to:cc:subject:date:message-id:content-type:mime-version; s= dk201812; bh=AqP+UQuis5Q4voI0Z3xjg/obdugCw1uEtDdx+BL6k08=; b=rvY BlQdocTXEeHcKKC/Yxm9cGv8LA07V1/gemPCKmDsDIW4vMQm/xeVbxpRPiXX7NNQ pc0SSzFz4MP/jMM5wqLSybPBmFVocFYaquN+UxGY5ckIDrz7nJ3BHAI/pk5R6TCs yWWHnwPFtw4qHlz2n4p+RRmtqVnESsJ1GSBVNUzKnWgyvyJRtfqR2ohiT596P4ba efO06Uz9LqaZ2ODFWt4GIRPcDplKS+xAyD7/PQ/XrTiBkXbNTwoKqyU/bYsL3wTf ziTIZ04KmbBMC/fTSowgNywfQ45akXH+qxuIrYPAiZfL9Q1mKjnuBEWcFQesxJOM k3teQiu7xxTXFO3MTrA== Received: from hhmail05.hh.imgtec.org ([217.156.249.195]) by mx07-00376f01.pphosted.com (PPS) with ESMTPS id 3t9r3sb8hn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 27 Sep 2023 13:42:58 +0100 (BST) Received: from HHMAIL04.hh.imgtec.org (10.100.10.119) by HHMAIL05.hh.imgtec.org (10.100.10.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 27 Sep 2023 13:42:57 +0100 Received: from GBR01-LO2-obe.outbound.protection.outlook.com (104.47.21.50) by email.imgtec.com (10.100.10.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31 via Frontend Transport; Wed, 27 Sep 2023 13:42:57 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YBRFxCxYyhy8LlX62ccayKNdCFtjOAu/l7jGD42jtlAZ0pzh8wOlS/328Xaw6CLUcMm4qtRbvVuPQWblwKGG9hVRlXNwaIxGT3A1fY3CGHsjjn2vEpYAn5KQXTagub0D9xO3xi5TU3owv+i1rbVOPSEFOPJK/Z+SDCkEev6nVtjzNPs6+397i7mqPBOBQvoW5RWVlspx/JwEuntTYk9JNc/fcGj7TuGKxvcdjHAZfSRus2vOYvovnavjYEGkJ9mZLVgeOvTO7Ag38EFw5aCpMGukVYG0A1rD4AE1qiv3IMl6FFpB6yib6GcpOG1ZGnaeqvVggkGS2c1SmxdYOSZbqg== 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=AqP+UQuis5Q4voI0Z3xjg/obdugCw1uEtDdx+BL6k08=; b=LLIQVLe6ESxo7zPOmWqtJBLEEDBXU+yirTmYZMI3aQW1SRY5WDu+WHQQbry4x8LlKYC0romBF6sM6ArusW8N3PIxE4e51Q2eAHWH2v4kvscLT0e8Ydg9UKXJ1nJxUU5Q+jZp1JkAQUNM6SAg/vTd7DK5JBTSrKPmyolvZtWQL4taAsSJrv2ZuWiGn/CC1bj9RMHmRUyEyM87tSJzncXn1rDCDLjqzGQgGhoC56+orjRyOed1XgNHrabZfoyOQOQoQheV/plHcO+HL5JgYCQqPsaTQI9jKbsa8wykxEeC5zP04jFG2u6825+SB0JnvVfqY+JBFrZTLnTEnmad0xNlvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=imgtec.com; dmarc=pass action=none header.from=imgtec.com; dkim=pass header.d=imgtec.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=IMGTecCRM.onmicrosoft.com; s=selector2-IMGTecCRM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AqP+UQuis5Q4voI0Z3xjg/obdugCw1uEtDdx+BL6k08=; b=CKYFBZx4a+c+T71MkFyRo+KhomTR2+Jqt03/woP1KcCNh5k0vFEASq3UcX2rWDTlPBUMJmcixpvvLXyQ0x2F2VN1ry+8hbqUDIHnqGErStFmmVhZRpPC4b+aZd3LVk3QyI4xM9Cj8XwNSTg0eboecfwCt3z8yQsv5JSGuQdctmc= Received: from LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:29f::11) by CWLP265MB6497.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:1e4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.21; Wed, 27 Sep 2023 12:42:55 +0000 Received: from LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM ([fe80::3fac:2722:f9cf:2f39]) by LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM ([fe80::3fac:2722:f9cf:2f39%4]) with mapi id 15.20.6838.016; Wed, 27 Sep 2023 12:42:55 +0000 From: Joseph Faulls <Joseph.Faulls@imgtec.com> To: "binutils@sourceware.org" <binutils@sourceware.org> CC: "jbeulich@suse.com" <jbeulich@suse.com>, "nelson@rivosinc.com" <nelson@rivosinc.com> Subject: [PATCH v2] RISC-V: Add support for numbered ISA mapping strings Thread-Topic: [PATCH v2] RISC-V: Add support for numbered ISA mapping strings Thread-Index: AdnxP8uRK0DGRlQDR/aBOhCTesjibg== Date: Wed, 27 Sep 2023 12:42:55 +0000 Message-ID: <LO4P265MB591487CCBB57E75FE05F23AF80C2A@LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LO4P265MB5914:EE_|CWLP265MB6497:EE_ x-ms-office365-filtering-correlation-id: 3ff58199-806b-4018-3533-08dbbf5745b9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fS6im4sAfeYhuQGW/D/RwEkaK9Ak1WX/o0SSpiBdTgKR1FzMOm7xcnyr1K2sLjLFh0Iewgtasz+rjv2q+XZ3qkI7ibcrAPoKu2KeFM292Z5Ehj2d72oaxhPq/1NAx3l8nCkCuWQEI6oPV7Dh2nfHvtf0QvSPKDnOHluPDCMk4bUn3+B3EUKvNCP7IhtSoSKP1jUhigGBZbW9wZK02lknJhOxzdtD3aveLrviBS9bx587Dd6+d0h+7/Q3VoQf3lB43S6oHAkV11cdNa2e+8mwcrjAGy6NQn9Zp+YPVStkJxXtJOFSFhLRudEH6aip2dRCYk9DB8ILKI8vVlRKXQx1eqwee8vetm8PDYcb35zMR5lP1EA5wAdInxu8+kDqkooJs+zh8hqXEqAZp+rBkexXSsX9jYFEc5iYMYcsgCA6rNH2K3DsQ6HkrlU9fTpgpWAuEeqPL3Onh2uKmkc3m7qzuzGmX3Bv5RQNBhQWiSdGVB//g/ZkmB8XhkcMgpwawKXy/CpCzpLXh6fBHemOzAvqp1wSlyYZQfF1gfz0UQ0dvLvYjPBlGDvnV5Ew9/eWITovdz3QOzYzcouGuhFMUNBvLtNmtFqtPhln3WdWVKeBLsVPB2SLzB6gKun5u2smqs0q x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(376002)(39850400004)(366004)(396003)(346002)(136003)(230922051799003)(451199024)(1800799009)(186009)(2906002)(316002)(8936002)(66476007)(4326008)(66556008)(41300700001)(5660300002)(52536014)(66446008)(64756008)(6916009)(66946007)(54906003)(8676002)(76116006)(478600001)(71200400001)(6506007)(7696005)(9686003)(26005)(83380400001)(38100700002)(55016003)(38070700005)(86362001)(33656002)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: 6HGUph00jz24daMR8jlRL2wyENfJhAP78NnJMmu08VksQASq/AltDsVeiheB9HAy2iReyFmHrnJ6dT0WwN1t7XNV5MZM8bmrT5hpgihycMjtvbj/A+xnnRUqIyHxrKcZNqRB27IOXGxix6dflGKoPCqxYmqeV+iO72n4WssV8i52wkwf1ljgv8j1KZi/Rl7r0Ph8RwbNhnY09YCNEEIia6a4fQf49a/wnBg0BjUUQle5mrHp+s2SGYNh1/4qLa9GpxI4k8rRxv48smiHk91bmLmAanLIeg6WNGYyqPC4b3fx8QTc6KRlprbYX0mlBiYxaRxtLAJCXVRU9Vwm8p0rztcHkNxd04HlWCKPSRGtzgdmdZaJOpijYUEIS+6RkvBGeMlLMxHk9g/F7NenapsWinRbDLjl7bwql3wjc5qHnX03Rzl4XGxto89FGsKKjc5hfSzGrsth2fiFACp6mkVT9vVHCJwG0Lj3/6JMNPnYc7SIdQWMUqwIdN6MbVWbtbGtKjncIRq/hs4pB7FYfru12yiyNVqAq0EYK+CTtYCQYs2DGY3RBg1umuAztv6R1RDPiX2/Odzfa9Ygmi2XyubGkdgTCidNkEpKoW0GCBFte1Hz9vGBdplpUcNnIhooK4AxHoabI685cU+w4UYPSs/K4NrLjmhU2cx6lf8gPWgROddebveXfigUgxa4dfMdDtZW3ePiKevqWppsXkWg2qhLjItZrkV++zxP+Q8sCsyZWSQUfCoupjAW8Fu2TVv/shnBtpaYmetuyINmykFa2OysyVTeWODwsIot6O3QbFQx3rIfh3b1uzvkqlCm+kaJx4mwCsR8fsdFnRqvIkyhOh/clUhWZZeStXY+xjYSfrNEuQVA/L5s2X+/nfue8XVj41UGRWKYwFVQipOZsd6Hm3/gafq6mQfnNNWU7lGFULorroXAH458emoanB0q6AQkUV8LlfmeUNfIAHyKsBhSkIUNIRkRmglsGpqu1FTzMeaJzoSvB/uPCQirqjDfUx7e/xFjPZDZZF921RlMXehH3qj6Tpx3kd6AggH2xQi0NiWF4nAHl+moVBZoNqq+SX85gclNvzWmkdDpaRYptDiJfawg3GXOq2xg5A3mKZmTjYDHuLGdAGZlvISVjagKnyggAIbAOKe/UXux1NhxSl5IZCYDkp7QOP6EHOWO7jwStJ3Ta5VS+y/jNSTZeoeXttq/wYAKucg2mBFx+mr9bAko7/nOnHtmPFrGArvTUVnqI6+cEmD4EmAfVWc/9bOXcltAYZpKCSOT15rUHRZDqbnFCqtwbdXaH/YlmlMZwtxF/nxvO5T9Vo2g8dR9+LmKHMeUbcqL6+QUwMDsfkchp7O941dPlwCXuaGOyu91YhVgn/26tANIJfFKN5vjk0kvYwS+YekLpLsv9zc6AsRG9dlhw2XPAeTw3qxDo/krYfQn9XNPp/HN5kKHiQNf4dvNdA5EmCx5+nETw08RXru4Hu+EnTRvgPU9AjoEgC9pwX3oStRdbLhI7L6zBNcbaCWJAmMMlrLuVNAezmvjCN3HujD5CzqP/MCYQiNmzdCSxSS/TH6BSpZD6FthRhR7Iv0y+PaW5f1w MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 3ff58199-806b-4018-3533-08dbbf5745b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Sep 2023 12:42:55.5878 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0d5fd8bb-e8c2-4e0a-8dd5-2c264f7140fe X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Wu2RdlTJQU7xiUeOmUiA8wO1FsMYffgoDhJc5tjcCKb6vGsZrqxDIBtrR+0xeXm38yoqp3eFyJZSK80DBbn1zYzHTwdUIlvlM7qVsGZFeoI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB6497 X-OriginatorOrg: imgtec.com X-EXCLAIMER-MD-CONFIG: 15a78312-3e47-46eb-9010-2e54d84a9631 X-Proofpoint-ORIG-GUID: MRJ9DTPTVIMlNKWRwdu50ukOdP8hezcy X-Proofpoint-GUID: MRJ9DTPTVIMlNKWRwdu50ukOdP8hezcy X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.30 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org Sender: "Binutils" <binutils-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
[v2] RISC-V: Add support for numbered ISA mapping strings
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 | success | Testing passed |
linaro-tcwg-bot/tcwg_binutils_check--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_binutils_build--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 | success | Testing passed |
Commit Message
Joseph Faulls
Sept. 27, 2023, 12:42 p.m. UTC
The elf psabi allows for mapping symbols to be of the form $x<ISA>.<any> opcodes/ * riscv-dis.c (riscv_get_map_state): allow mapping symbol to be suffixed by a unique identifier .<any> Changes from v1: * Use xmalloc (thanks Jan) --- opcodes/riscv-dis.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) -- 2.34.1
Comments
Okay, although the current GNU assembler won't generate numbered architecture strings, other tools may generate, so this looks reasonable. Thanks Nelson On Wed, Sep 27, 2023 at 8:42 PM Joseph Faulls <Joseph.Faulls@imgtec.com> wrote: > The elf psabi allows for mapping symbols to be of the form $x<ISA>.<any> > > > > opcodes/ > > * riscv-dis.c (riscv_get_map_state): allow mapping symbol to > > be suffixed by a unique identifier .<any> > > > > Changes from v1: > > - Use xmalloc (thanks Jan) > > --- > > opcodes/riscv-dis.c | 18 +++++++++++++++++- > > 1 file changed, 17 insertions(+), 1 deletion(-) > > > > diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c > > index c0fd0625a2d..18a5c26f9a6 100644 > > --- a/opcodes/riscv-dis.c > > +++ b/opcodes/riscv-dis.c > > @@ -869,7 +869,23 @@ riscv_get_map_state (int n, > > { > > *state = MAP_INSN; > > riscv_release_subset_list (&riscv_subsets); > > - riscv_parse_subset (&riscv_rps_dis, name + 2); > > + > > + /* ISA mapping string may be numbered, suffixed with '.n'. Do not > > + consider this as part of the ISA string. */ > > + char *suffix = strchr (name, '.'); > > + if (suffix) > > + { > > + int suffix_index = (int)(suffix - name); > > + char *name_substr = xmalloc (suffix_index + 1); > > + strncpy (name_substr, name, suffix_index); > > + name_substr[suffix_index] = '\0'; > > + riscv_parse_subset (&riscv_rps_dis, name_substr + 2); > > + free (name_substr); > > + } > > + else > > + { > > + riscv_parse_subset (&riscv_rps_dis, name + 2); > > + } > > } > > else > > return false; > > -- > > 2.34.1 >
Ping
If this looks good, could someone commit it?
Thanks,
Joe
From: Nelson Chu <nelson@rivosinc.com>
Sent: Thursday, September 28, 2023 2:41 AM
To: Joseph Faulls <Joseph.Faulls@imgtec.com>
Cc: binutils@sourceware.org; jbeulich@suse.com
Subject: [EXTERNAL] Re: [PATCH v2] RISC-V: Add support for numbered ISA mapping strings
Okay, although the current GNU assembler won't generate numbered architecture strings, other tools may generate, so this looks reasonable.
Thanks
Nelson
On Wed, Sep 27, 2023 at 8:42 PM Joseph Faulls <Joseph.Faulls@imgtec.com<mailto:Joseph.Faulls@imgtec.com>> wrote:
The elf psabi allows for mapping symbols to be of the form $x<ISA>.<any>
opcodes/
* riscv-dis.c (riscv_get_map_state): allow mapping symbol to
be suffixed by a unique identifier .<any>
Changes from v1:
* Use xmalloc (thanks Jan)
---
opcodes/riscv-dis.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c
index c0fd0625a2d..18a5c26f9a6 100644
--- a/opcodes/riscv-dis.c
+++ b/opcodes/riscv-dis.c
@@ -869,7 +869,23 @@ riscv_get_map_state (int n,
{
*state = MAP_INSN;
riscv_release_subset_list (&riscv_subsets);
- riscv_parse_subset (&riscv_rps_dis, name + 2);
+
+ /* ISA mapping string may be numbered, suffixed with '.n'. Do not
+ consider this as part of the ISA string. */
+ char *suffix = strchr (name, '.');
+ if (suffix)
+ {
+ int suffix_index = (int)(suffix - name);
+ char *name_substr = xmalloc (suffix_index + 1);
+ strncpy (name_substr, name, suffix_index);
+ name_substr[suffix_index] = '\0';
+ riscv_parse_subset (&riscv_rps_dis, name_substr + 2);
+ free (name_substr);
+ }
+ else
+ {
+ riscv_parse_subset (&riscv_rps_dis, name + 2);
+ }
}
else
return false;
--
2.34.1
Committed with indents fixing. Nelson On Thu, Oct 12, 2023 at 11:46 PM Joseph Faulls <Joseph.Faulls@imgtec.com> wrote: > Ping > > > > If this looks good, could someone commit it? > > > > Thanks, > Joe > > > > *From:* Nelson Chu <nelson@rivosinc.com> > *Sent:* Thursday, September 28, 2023 2:41 AM > *To:* Joseph Faulls <Joseph.Faulls@imgtec.com> > *Cc:* binutils@sourceware.org; jbeulich@suse.com > *Subject:* [EXTERNAL] Re: [PATCH v2] RISC-V: Add support for numbered ISA > mapping strings > > Okay, although the current GNU assembler won't generate numbered > architecture strings, other tools may generate, so this looks reasonable. > > > > Thanks > > Nelson > > > > On Wed, Sep 27, 2023 at 8:42 PM Joseph Faulls <Joseph.Faulls@imgtec.com> > wrote: > > The elf psabi allows for mapping symbols to be of the form $x<ISA>.<any> > > > > opcodes/ > > * riscv-dis.c (riscv_get_map_state): allow mapping symbol to > > be suffixed by a unique identifier .<any> > > > > Changes from v1: > > - Use xmalloc (thanks Jan) > > --- > > opcodes/riscv-dis.c | 18 +++++++++++++++++- > > 1 file changed, 17 insertions(+), 1 deletion(-) > > > > diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c > > index c0fd0625a2d..18a5c26f9a6 100644 > > --- a/opcodes/riscv-dis.c > > +++ b/opcodes/riscv-dis.c > > @@ -869,7 +869,23 @@ riscv_get_map_state (int n, > > { > > *state = MAP_INSN; > > riscv_release_subset_list (&riscv_subsets); > > - riscv_parse_subset (&riscv_rps_dis, name + 2); > > + > > + /* ISA mapping string may be numbered, suffixed with '.n'. Do not > > + consider this as part of the ISA string. */ > > + char *suffix = strchr (name, '.'); > > + if (suffix) > > + { > > + int suffix_index = (int)(suffix - name); > > + char *name_substr = xmalloc (suffix_index + 1); > > + strncpy (name_substr, name, suffix_index); > > + name_substr[suffix_index] = '\0'; > > + riscv_parse_subset (&riscv_rps_dis, name_substr + 2); > > + free (name_substr); > > + } > > + else > > + { > > + riscv_parse_subset (&riscv_rps_dis, name + 2); > > + } > > } > > else > > return false; > > -- > > 2.34.1 > >
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c index c0fd0625a2d..18a5c26f9a6 100644 --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -869,7 +869,23 @@ riscv_get_map_state (int n, { *state = MAP_INSN; riscv_release_subset_list (&riscv_subsets); - riscv_parse_subset (&riscv_rps_dis, name + 2); + + /* ISA mapping string may be numbered, suffixed with '.n'. Do not + consider this as part of the ISA string. */ + char *suffix = strchr (name, '.'); + if (suffix) + { + int suffix_index = (int)(suffix - name); + char *name_substr = xmalloc (suffix_index + 1); + strncpy (name_substr, name, suffix_index); + name_substr[suffix_index] = '\0'; + riscv_parse_subset (&riscv_rps_dis, name_substr + 2); + free (name_substr); + } + else + { + riscv_parse_subset (&riscv_rps_dis, name + 2); + } } else return false;