[PATCH 2/8] RISC-V: Don't allow any uppercase letter in the arch string.

Andreas Schwab schwab@linux-m68k.org
Fri Nov 27 11:57:41 GMT 2020


On Nov 26 2020, Nelson Chu wrote:

> 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);

What about non-letters?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


More information about the Binutils mailing list