]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
RISC-V: Fix the order checking for Z* extension.
authorNelson Chu <nelson.chu@sifive.com>
Fri, 20 Nov 2020 15:42:28 +0000 (23:42 +0800)
committerNelson Chu <nelson.chu@sifive.com>
Tue, 1 Dec 2020 07:24:10 +0000 (15:24 +0800)
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.

bfd/ChangeLog
bfd/elfxx-riscv.c

index 2a5ae822cc501a97455288f3b4539b0ec8315475..b3bcf9ea1e675e686a9ea71f9c40358a5f23b640 100644 (file)
@@ -1,3 +1,8 @@
+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
index 711b367718046341d4cf0d5268e89a8586b958e1..06967804d6cc0bb15e6e62f13e266a887d9246ed 100644 (file)
@@ -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 "