[PATCH] arm: ignore inapplicable .arch=no...

Richard Earnshaw (lists) Richard.Earnshaw@arm.com
Wed Apr 30 14:10:50 GMT 2025


On 30/04/2025 14:34, Jan Beulich wrote:
> Unlike for command line options, where a base architecture needs to be
> provided explicitly, the .arch directive doesn't have such a
> requirement. Therefore it is odd that disabling of an inapplicable
> extension isn't silently ignored; claiming "not allowed for the current
> base architecture" is at best misleading. Simply skip the error path,
> leveraging that in such a case ARM_CLEAR_FEATURE() is (supposed to be)
> a no-op.
> 
> --- a/gas/config/tc-arm.c
> +++ b/gas/config/tc-arm.c
> @@ -32792,7 +32792,7 @@ s_arm_arch_extension (int ignored ATTRIB
>  	      break;
>  	  }
>  
> -	if (i == nb_allowed_archs)
> +	if (i == nb_allowed_archs && adding_value)
>  	  {
>  	    as_bad (_("architectural extension `%s' is not allowed for the "
>  		      "current base architecture"), name);


Sorry, I don't follow the logic you have in mind.  Trying to enable, for example, MVE on an a-profile architecture is completely meaningless and should be diagnosed as an error in the source file.

Can you give an example of what you're trying to permit here?

R.


More information about the Binutils mailing list