This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]