diff options
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elfxx-riscv.c | 14 | ||||
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-uppercase-base.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-uppercase-x.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-uppercase.l | 2 |
6 files changed, 29 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4c6c694..3ac2719 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2020-12-01 Nelson Chu <nelson.chu@sifive.com> + * elfxx-riscv.c (riscv_parse_subset): ISA string cannot contain + any uppercase letter. + +2020-12-01 Nelson Chu <nelson.chu@sifive.com> + * elfxx-riscv.c: Re-indent codes, unify and improve the error messages and comments. (riscv_parse_prefixed_ext): Stop parsing the prefixed class diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index 5ed8aa0..69f3a43 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1510,9 +1510,21 @@ bfd_boolean riscv_parse_subset (riscv_parse_subset_t *rps, const char *arch) { - const char *p = arch; + const char *p; size_t i; + for (p = arch; *p != '\0'; p++) + { + if (ISUPPER (*p)) + { + rps->error_handler + (_("-march=%s: ISA string cannot contain uppercase letters"), + arch); + return FALSE; + } + } + + p = arch; if (strncmp (p, "rv32", 4) == 0) { *rps->xlen = 32; diff --git a/gas/ChangeLog b/gas/ChangeLog index 6ab777e..2a2b593 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,11 @@ 2020-12-01 Nelson Chu <nelson.chu@sifive.com> + * testsuite/gas/riscv/march-fail-uppercase-base.d: Updated. + * testsuite/gas/riscv/march-fail-uppercase.l: Updated. + * testsuite/gas/riscv/march-fail-uppercase-x.d: New testcase. + +2020-12-01 Nelson Chu <nelson.chu@sifive.com> + (These are new testcases that cover more cases) * testsuite/gas/riscv/march-fail-base-01.d: The first extension must be e, i or g. diff --git a/gas/testsuite/gas/riscv/march-fail-uppercase-base.d b/gas/testsuite/gas/riscv/march-fail-uppercase-base.d index 74b55ea..8b59585 100644 --- a/gas/testsuite/gas/riscv/march-fail-uppercase-base.d +++ b/gas/testsuite/gas/riscv/march-fail-uppercase-base.d @@ -1,3 +1,3 @@ #as: -march=rv32I #source: empty.s -#error_output: march-fail-base-01.l +#error_output: march-fail-uppercase.l diff --git a/gas/testsuite/gas/riscv/march-fail-uppercase-x.d b/gas/testsuite/gas/riscv/march-fail-uppercase-x.d new file mode 100644 index 0000000..316351f --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-uppercase-x.d @@ -0,0 +1,3 @@ +#as: -march=rv32ic_zicsr_xARGLE +#source: empty.s +#error_output: march-fail-uppercase.l diff --git a/gas/testsuite/gas/riscv/march-fail-uppercase.l b/gas/testsuite/gas/riscv/march-fail-uppercase.l index 2053135..292c18a 100644 --- a/gas/testsuite/gas/riscv/march-fail-uppercase.l +++ b/gas/testsuite/gas/riscv/march-fail-uppercase.l @@ -1,2 +1,2 @@ .*Assembler messages: -.*Fatal error: .*unknown (standard|z) ISA extension.* +.*Fatal error: .*ISA string cannot contain uppercase letters |