Although I cannot find any RISC-V specs said that uppercases are not
allowed in the arhc string, but seems like it is an established fact
both for GNU and LLVM. Therefore, we shouldn't allow the uppercases
for the non-standard x extensions, too.
bfd/
* elfxx-riscv.c (riscv_parse_subset): ISA string cannot contain
any uppercase letter.
gas/
* 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>
+
+ * 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
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;
+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)
#as: -march=rv32I
#source: empty.s
-#error_output: march-fail-base-01.l
+#error_output: march-fail-uppercase.l
--- /dev/null
+#as: -march=rv32ic_zicsr_xARGLE
+#source: empty.s
+#error_output: march-fail-uppercase.l
.*Assembler messages:
-.*Fatal error: .*unknown (standard|z) ISA extension.*
+.*Fatal error: .*ISA string cannot contain uppercase letters