[PATCH] bfd/riscv: tighten matching rules in riscv_scan
Andrew Burgess
andrew.burgess@embecosm.com
Wed Jun 24 08:03:41 GMT 2020
* Andreas Schwab <schwab@linux-m68k.org> [2020-06-24 08:09:51 +0200]:
> On Jun 23 2020, Andrew Burgess wrote:
>
> > The solution I propose is to prevent the default architecture from
> > taking part in this "ignore trailing characters" extra match case,
> > only the more specific 'riscv:rv32' and 'riscv:rv64' get this extra
> > matching.
>
> How about rejecting the match if a colon follows?
I assume you mean something like this (untested) code:
if (strncasecmp (string, info->printable_name,
strlen (info->printable_name)) == 0
&& string[strlen (info->printable_name)] != ':')
return TRUE;
I prefer my original solution over this as this would mean that the
string 'riscvBLAH' would match again the 'riscv' architecture.
My assumption that 'riscv' is supposed to be a generic RISC-V
architecture, with smart detection of 32/64 bit, and include as many
non-conflicting core extensions as possible, so I'm not sure having
extension characters after the 'riscv' string makes sense.
At the end of the day though, the above would resolve my immediate
problem, so if you feel strongly that it's a better solution I'm
willing to go with that.
Thanks,
Andrew
>
> 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