aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelson Chu <nelson.chu@sifive.com>2021-01-04 10:12:45 +0800
committerNelson Chu <nelson.chu@sifive.com>2021-01-04 11:17:33 +0800
commit4c0e540e47e8ea26e20246c33c744306944b4cb8 (patch)
treeb0c211f9ec492e90888cad664152051df6fe1cf1 /bfd/elfxx-riscv.c
parentPR26741, benign use after free in riscv_parse_prefixed_ext (diff)
downloadbinutils-gdb-4c0e540e47e8ea26e20246c33c744306944b4cb8.tar.gz
binutils-gdb-4c0e540e47e8ea26e20246c33c744306944b4cb8.tar.bz2
binutils-gdb-4c0e540e47e8ea26e20246c33c744306944b4cb8.zip
RISC-V: Fix the merged orders of Z* extension for linker.
Similar to the commit 6729e2c2af2bd94408430734316597843718a484, we have to check the first char of the Z* extensions, to make sure that they follow the order of the standard extensions. bfd/ * elfxx-riscv.c (riscv_compare_subsets): Removed static. * elfxx-riscv.h: Add declaration. * elfnn-riscv.c (riscv_merge_multi_letter_ext): Use riscv_compare_subsets to check the orders. (riscv_skip_prefix): Removed. (riscv_prefix_cmp): Removed.
Diffstat (limited to 'bfd/elfxx-riscv.c')
-rw-r--r--bfd/elfxx-riscv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 101e27f8202..d3b64720a5d 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1037,7 +1037,7 @@ static int riscv_ext_order[26] = {0};
or greater than zero if `subset2` is found, respectively, to be less
than, to match, or be greater than `subset1`. */
-static int
+int
riscv_compare_subsets (const char *subset1, const char *subset2)
{
int order1 = riscv_ext_order[(*subset1 - 'a')];