[PATCH 1/4] RISC-V: Fix order check when use 'z*' sub-extensions

jiawei jiawei@iscas.ac.cn
Tue Nov 2 09:44:00 GMT 2021


---
 bfd/elfxx-riscv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index cdb4fa0996a..0d8fc755b5c 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1333,7 +1333,7 @@ riscv_compare_subsets (const char *subset1, const char *subset2)
 	  order1 = riscv_ext_order[(*++subset1 - 'a')];
 	  order2 = riscv_ext_order[(*++subset2 - 'a')];
 	  if (order1 != order2)
-	    return order1 - order2;
+	    return order2 - order1;
 	}
       return strcasecmp (++subset1, ++subset2);
     }
-- 
2.25.1



More information about the Binutils mailing list