aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelson Chu <nelson.chu@sifive.com>2020-11-20 23:42:28 +0800
committerNelson Chu <nelson.chu@sifive.com>2020-12-01 15:24:10 +0800
commit6729e2c2af2bd94408430734316597843718a484 (patch)
tree6d90a85ca4307af4915111cd30cae2efc6b20b1a
parent00d4d1b0a3a4d26c9d741b14e601ed2b86fe39ee (diff)
downloadgdb-6729e2c2af2bd94408430734316597843718a484.zip
gdb-6729e2c2af2bd94408430734316597843718a484.tar.gz
gdb-6729e2c2af2bd94408430734316597843718a484.tar.bz2
RISC-V: Fix the order checking for Z* extension.
We have to check the first char of the Z* extensions, to make sure that they follow the order of the standard extensions. But we can not have the testcases for this patch, since we only support the zicsr and zifencei so far, both of them are the sub extensions of i. bfd/ * elfxx-riscv.c (riscv_parse_prefixed_ext): Use riscv_compare_subsets to check the Z* extensions' order.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-riscv.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2a5ae82..b3bcf9e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2020-12-01 Nelson Chu <nelson.chu@sifive.com>
+ * elfxx-riscv.c (riscv_parse_prefixed_ext): Use riscv_compare_subsets
+ to check the Z* extensions' order.
+
+2020-12-01 Nelson Chu <nelson.chu@sifive.com>
+
* elfxx-riscv.c (riscv_parse_add_subset): Allow to add g with
RISCV_UNKNOWN_VERSION versions.
(riscv_parse_std_ext): Add g to the subset list, we only use it
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 711b367..0696780 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1543,8 +1543,7 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
}
/* Check that the extension is in alphabetical order. */
- if (!strncasecmp (last_name, config->prefix, 1)
- && strcasecmp (last_name, subset) > 0)
+ if (riscv_compare_subsets (last_name, subset) > 0)
{
rps->error_handler
(_("-march=%s: %s ISA extension `%s' is not in alphabetical "