Matthieu Longo <matthieu.lo...@arm.com> writes:
> @@ -24803,6 +24834,16 @@ aarch64_start_file (void)
>     asm_fprintf (asm_out_file, "\t.arch %s\n",
>               aarch64_last_printed_arch_string.c_str ());
>  
> +  /* Check whether the current assembly supports gcs build attributes, if not
> +     fallback to .note.gnu.property section.  */
> +#if (HAVE_AS_AEABI_BUILD_ATTRIBUTES)
> +  if (aarch64_gcs_enabled ())

I was hoping we could instead use:

  if (HAVE_AS_AEABI_BUILD_ATTRIBUTES && aarch64_gcs_enabled ())

so that the code is parsed but compiled out when the new syntax is not
supported.  This avoids cases where a patch that works with a new
assembler breaks bootstrap when using an older assembler, or vice
versa.

> +    {
> +      aarch64_emit_aeabi_subsection (".aeabi-feature-and-bits", 1, 0);
> +      aarch64_emit_aeabi_attribute ("Tag_Feature_GCS", 3, 1);
> +    }
> +#endif
> +
>     default_file_start ();
>  }
>  
> [...]
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 8a5fed516b3..f4b1343ca70 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -4387,6 +4387,16 @@ case "$target" in
>       ldr     x0, [[x2, #:gotpage_lo15:globalsym]]
>      ],,[AC_DEFINE(HAVE_AS_SMALL_PIC_RELOCS, 1,
>       [Define if your assembler supports relocs needed by -fpic.])])
> +    # Check if we have binutils support for AEABI build attributes.
> +    gcc_GAS_CHECK_FEATURE([support of AEABI build attributes], 
> gcc_cv_as_aarch64_aeabi_build_attributes,,
> +    [
> +     .set ATTR_TYPE_uleb128,   0
> +     .set ATTR_TYPE_asciz,     1

Very minor, but: we can drop this line, since it isn't used in the test.
Same for the corresponding Tcl test.

OK with those changes, thanks.

Richard

> +     .set Tag_Feature_foo,     1
> +     .aeabi_subsection .aeabi-feature-and-bits, 1, ATTR_TYPE_uleb128
> +     .aeabi_attribute Tag_Feature_foo, 1
> +    ],,[AC_DEFINE(HAVE_AS_AEABI_BUILD_ATTRIBUTES, 1,
> +     [Define if your assembler supports AEABI build attributes.])])
>      # Enable Branch Target Identification Mechanism and Return Address
>      # Signing by default.
>      AC_ARG_ENABLE(standard-branch-protection,

Reply via email to