This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] [ARC] Fix handling of cpu=... disassembler option value
- From: Pedro Alves <palves at redhat dot com>
- To: Anton Kolesov <Anton dot Kolesov at synopsys dot com>, binutils at sourceware dot org
- Cc: Francois Bedard <Francois dot Bedard at synopsys dot com>, Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>, Cupertino Miranda <Cupertino dot Miranda at synopsys dot com>
- Date: Fri, 16 Jun 2017 11:30:12 +0100
- Subject: Re: [PATCH] [ARC] Fix handling of cpu=... disassembler option value
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 91883C0587F6
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 91883C0587F6
- References: <20170615145946.4158-1-Anton.Kolesov@synopsys.com>
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