[PATCH] [ARC] Fix handling of cpu=... disassembler option value

Pedro Alves palves@redhat.com
Fri Jun 16 10:30:00 GMT 2017


On 06/15/2017 03:59 PM, Anton Kolesov wrote:
> There is a bug in handling of cpu=... disassembler option in case there are
> other options after it, for example, `cpu=EM,dsp'.  In this case `EM,dsp' is
> treated as an option value, and strcasecmp reports is as non-equal to "EM".
> This could have been fixed by using strncasecmp and passing length of
> cpu_types[i].name as size argument, or using strcasestr, but that would cause
> another problem as value `em4,dsp' would be equal to `em' cpy_type.name in
> those cases.  Therefore the right solution is to extract value of cpu option
> fully and pass it as an argument to parse_cpu_option.

Couldn't this use disassembler_options_cmp / FOR_EACH_DISASSEMBLER_OPTION?
See e.g. ppc-dis.c:ppc_parse_cpu for example.

Thanks,
Pedro Alves



More information about the Binutils mailing list