RISC-V: Maintain a string to hold the canonical order
authorKito Cheng <kito.cheng@sifive.com>
Mon, 21 Feb 2022 15:14:31 +0000 (23:14 +0800)
committerNelson Chu <nelson.chu@sifive.com>
Tue, 22 Feb 2022 01:54:09 +0000 (09:54 +0800)
commit3a3e333f65483b864bf2624392f8aa4a88c7a498
treee97bc91ea93a4662daed9d1e7ff72cd9a16e2b67
parentfadefdc51882bcf1cf04138facb29f390be9a04e
RISC-V: Maintain a string to hold the canonical order

Using dummy entry in riscv_supported_std_ext cause confusing and wrongly
support `b` and `k` extensions.

bfd/
* elfxx-riscv.c (riscv_supported_std_ext): Drop unsupported
extensions.
(riscv_ext_canonical_order): New.
(riscv_init_ext_order): Use riscv_ext_canonical_order rather
than riscv_supported_std_ext to compute canonical order.

V2 Changes:

- Use `*ext` rather than `*ext != NULL` for checking is reach end of
  string.
bfd/elfxx-riscv.c