This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] aarch64: allow adding/removing just feature flags via .arch_extension
- From: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>
- To: Jan Beulich <JBeulich at suse dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, Richard Earnshaw <rearnsha at arm dot com>
- Date: Mon, 3 Nov 2014 17:44:42 +0000
- Subject: Re: [PATCH] aarch64: allow adding/removing just feature flags via .arch_extension
- Authentication-results: sourceware.org; auth=none
- References: <544A64EC0200007800041F06 at mail dot emea dot novell dot com>
Hi
On 24 October 2014 13:40, Jan Beulich <JBeulich@suse.com> wrote:
> static int
> -aarch64_parse_features (char *str, const aarch64_feature_set **opt_p)
> +aarch64_parse_features (char *str, const aarch64_feature_set **opt_p,
> + char *ext)
The new parameter here is being used as a boolean flag, represent it
with a bfd_boolean rather than a char *.
> {
> /* We insist on extensions being added before being removed. We achieve
> this by using the ADDING_VALUE variable to indicate whether we are
> @@ -7267,16 +7270,18 @@ aarch64_parse_features (char *str, const
> while (str != NULL && *str != 0)
> {
> const struct aarch64_option_cpu_value_table *opt;
> - char *ext;
> int optlen;
>
> - if (*str != '+')
> + if (!ext)
> {
> - as_bad (_("invalid architectural extension"));
> - return 0;
> - }
> + if (*str != '+')
> + {
> + as_bad (_("invalid architectural extension"));
> + return 0;
> + }
>
> - str++;
> + str++;
> + }
> ext = strchr (str, '+');
The logic here is odd. I don;t think we want this in the case when ext
!= NULL. The effect is that:
.arch_extension +crc
...will give a "missing extension" rather than an "unknown extension"
error message.
Cheers
/Marcus