0011-RISC-V-Fix-the-order-checking-for-Z-extension.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. From 6424f98467fbdd6d7ad8fad1c9ba4fd6a517f846 Mon Sep 17 00:00:00 2001
  2. From: Nelson Chu <nelson.chu@sifive.com>
  3. Date: Fri, 20 Nov 2020 23:42:28 +0800
  4. Subject: [PATCH 11/48] RISC-V: Fix the order checking for Z* extension.
  5. We have to check the first char of the Z* extensions, to make sure that
  6. they follow the order of the standard extensions. But we can not have
  7. the testcases for this patch, since we only support the zicsr and zifencei
  8. so far, both of them are the sub extensions of i.
  9. bfd/
  10. * elfxx-riscv.c (riscv_parse_prefixed_ext): Use riscv_compare_subsets
  11. to check the Z* extensions' order.
  12. ---
  13. bfd/elfxx-riscv.c | 3 +--
  14. 1 file changed, 1 insertion(+), 2 deletions(-)
  15. diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
  16. index 7ff8c52620..86c0d94d0e 100644
  17. --- a/bfd/elfxx-riscv.c
  18. +++ b/bfd/elfxx-riscv.c
  19. @@ -1528,8 +1528,7 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
  20. }
  21. /* Check that the extension is in alphabetical order. */
  22. - if (!strncasecmp (last_name, config->prefix, 1)
  23. - && strcasecmp (last_name, subset) > 0)
  24. + if (riscv_compare_subsets (last_name, subset) > 0)
  25. {
  26. rps->error_handler
  27. (_("-march=%s: %s ISA extension `%s' is not in alphabetical "
  28. --
  29. 2.33.0