[PATCH v3] aarch64: silence GCS warnings on shared libraries for -z gcs=implicit
Alice Carlotti
alice.carlotti@arm.com
Tue Jan 20 20:31:33 GMT 2026
On Mon, Jan 19, 2026 at 11:56:17AM +0000, Matthieu Longo wrote:
> Dynamic library incompatibilities should not be reported when no GCS
> option is provided (defaults to '-z gcs=implicit') and no explicit
> diagnostic is provided via '-z gcs-report-dynamic'.
>
> Binary Linux distributions do not rebuild all packages from scratch
> when rolling out a new feature or creating a new release; only
> modified packages get rebuilt. In the context of GCS deployment, this
> meant that some packages were rebuilt with GCS enabled while their
> dependencies were not yet GCS-compatible, resulting in warnings. These
> warnings caused build failures for packages that treat linker warnings
> as errors. Those errors slowed down the GCS deployment, and Linux
> distribution maintainers requested that no GCS option provided should
> be equivalent to '-z gcs=implicit -z gcs-report-dynamic=none'.
>
> In contrast, '-z gcs=always' should continue to report such issues by
> default. Warnings can still be disabled or promoted to errors by
> explicitly setting '-z gcs-report-dynamic' to respectively 'none' or
> 'error'.
>
> This patch preserves the existing behaviour for '-z gcs=never', changes
> the default behaviour of '-z gcs=implicit' or no GCS option, and removed
> the inheritance mechanism between '-z gcs-report' and '-z gcs-report-dynamics'.
> The expected behaviour with the different possible combinations is as
> follows:
> * -z gcs=never:
> No diagnostic messages are emitted.
> * -z gcs=implicit:
> No diagnostic messages are emitted for input static objects.
> However, if all the input static objects are marked for GCS, the
> output object will also be marked for GCS.
> In this case the output is marked with GCS, '-z gcs-report-dynamic'
> defaults to 'none' and no diagnostics are emitted. Diagnostics can
> be enabled by explicitly providing the option.
> * -z gcs=always:
> Warning diagnostics for both static and dynamic input objects are
> enabled by default. The two options are independent of one another,
> and the diagnostic level can be adjusted for each by explicitly
> providing the desired level to '-z gcs-report-dynamic' and '-z
> gcs-report'.
>
> The patch also updates the existing tests, removes redundant test cases,
> and adds new tests covering cases with no report option provided, or
> report options explicitly set.
This patch removes all tests for mixed inputs and '-z gcs=implicit'. I think
it would be appropriate to retain the the old test gcs-3-b-i.d (presumably
renamed to gcs-3-b.d with an adjusted #name) to cover this case.
OK with this change.
On Fri, Jan 16, 2026 at 04:46:16PM +0000, Matthieu Longo wrote:
> The testsuite changes are actually related.
> The change in behavior made some tests redundant so were deleted.
> The naming of the tests had to shift to keep some coherence in the naming,
> which created some churn.
> Hence my advice in a previous email to review the tests in their globality
> from your editor by applying the patch on your tree.
> Splitting those changes don't make much sense in this context.
I can see your point better now - until I looked more closely and copied out
the list of test files, I hadn't noticed quite how many tests were added and
removed as part of the patch. I think there is still scope to make the diffs
a bit more readable if you want - my suggestion to do so would be split the
changes into:
- all file deletions,
- all file renaming,
- everything else.
This is entirely optional - I'm happy for you to keep this as a single patch.
Alice
> ---
> bfd/elfnn-aarch64.c | 73 ++++++++++++++-----
> ld/emultempl/aarch64elf.em | 4 +-
> ld/ld.texi | 42 +++++------
> ld/testsuite/ld-aarch64/protections/gcs-1-c.d | 2 +-
> ld/testsuite/ld-aarch64/protections/gcs-1-d.d | 2 +-
> .../ld-aarch64/protections/gcs-2-a-i.d | 2 +-
> .../ld-aarch64/protections/gcs-2-a-ii.d | 2 +-
> .../ld-aarch64/protections/gcs-2-b-i.d | 2 +-
> .../ld-aarch64/protections/gcs-2-b-ii.d | 2 +-
> .../ld-aarch64/protections/gcs-2-b-iii.d | 9 +--
> .../ld-aarch64/protections/gcs-2-b-iv.d | 7 --
> .../ld-aarch64/protections/gcs-2-c-i.d | 2 +-
> .../ld-aarch64/protections/gcs-2-c-ii.d | 2 +-
> .../{gcs-3-c-ii.d => gcs-2-c-iii.d} | 4 +-
> .../ld-aarch64/protections/gcs-3-a-i.d | 2 +-
> .../ld-aarch64/protections/gcs-3-a-ii.d | 2 +-
> .../ld-aarch64/protections/gcs-3-a-iii.d | 2 +-
> .../ld-aarch64/protections/gcs-3-a-iv.d | 2 +-
> .../ld-aarch64/protections/gcs-3-b-i.d | 8 --
> .../ld-aarch64/protections/gcs-3-b-ii.d | 8 --
> .../ld-aarch64/protections/gcs-3-b-iii.d | 8 --
> .../ld-aarch64/protections/gcs-3-c-i.d | 8 --
> .../ld-aarch64/protections/gcs-3-c-iii.d | 8 --
> .../ld-aarch64/protections/gcs-dynamic-1-a.d | 4 +-
> .../ld-aarch64/protections/gcs-dynamic-1-b.d | 2 +-
> .../protections/gcs-dynamic-2-a-ii.d | 8 --
> ...{gcs-dynamic-2-a-i.d => gcs-dynamic-2-a.d} | 2 +-
> .../ld-aarch64/protections/gcs-dynamic-2-b.d | 14 +---
> .../ld-aarch64/protections/gcs-dynamic-2-c.d | 7 +-
> .../ld-aarch64/protections/gcs-dynamic-2-d.d | 6 +-
> .../ld-aarch64/protections/gcs-dynamic-3-a.d | 15 +---
> .../ld-aarch64/protections/gcs-dynamic-3-b.d | 6 +-
> .../ld-aarch64/protections/gcs-dynamic-3-c.d | 6 +-
> ...gcs-dynamic-2-a-iv.d => gcs-dynamic-3-d.d} | 6 +-
> .../ld-aarch64/protections/gcs-dynamic-3-e.d | 12 +++
> ...cs-dynamic-2-a-iii.d => gcs-dynamic-3-f.d} | 7 +-
> .../ld-aarch64/protections/gcs-dynamic-4-a.d | 4 +-
> .../ld-aarch64/protections/gcs-dynamic-4-b.d | 7 --
> .../ld-aarch64/protections/gcs-dynamic-4-c.d | 7 --
> 39 files changed, 133 insertions(+), 183 deletions(-)
> delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-2-b-iv.d
> rename ld/testsuite/ld-aarch64/protections/{gcs-3-c-ii.d => gcs-2-c-iii.d} (58%)
> delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-3-b-i.d
> delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-3-b-ii.d
> delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-3-b-iii.d
> delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-3-c-i.d
> delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-3-c-iii.d
> delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-ii.d
> rename ld/testsuite/ld-aarch64/protections/{gcs-dynamic-2-a-i.d => gcs-dynamic-2-a.d} (84%)
> rename ld/testsuite/ld-aarch64/protections/{gcs-dynamic-2-a-iv.d => gcs-dynamic-3-d.d} (51%)
> create mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-e.d
> rename ld/testsuite/ld-aarch64/protections/{gcs-dynamic-2-a-iii.d => gcs-dynamic-3-f.d} (61%)
> delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-b.d
> delete mode 100644 ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-c.d
>
> diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
> index 00a4f171cf1..d0be20ee459 100644
> --- a/bfd/elfnn-aarch64.c
> +++ b/bfd/elfnn-aarch64.c
> @@ -5040,40 +5040,73 @@ bfd_elfNN_aarch64_set_options (struct bfd *output_bfd,
> elf_aarch64_tdata (output_bfd)->no_enum_size_warning = no_enum_warn;
> elf_aarch64_tdata (output_bfd)->no_wchar_size_warning = no_wchar_warn;
>
> - /* Note: gnu_property_aarch64_feature_1_and was initialized to 0 by
> - bfd_zalloc(). */
> + uint32_t gnu_property_aarch64_feature_1_and = 0;
> + aarch64_feature_marking_report gcs_report;
> + aarch64_feature_marking_report gcs_report_dynamic;
> +
> if (sw_protections->plt_type & PLT_BTI)
> - elf_aarch64_tdata (output_bfd)->gnu_property_aarch64_feature_1_and
> - |= GNU_PROPERTY_AARCH64_FEATURE_1_BTI;
> + gnu_property_aarch64_feature_1_and |= GNU_PROPERTY_AARCH64_FEATURE_1_BTI;
>
> switch (sw_protections->gcs_type)
> {
> case GCS_ALWAYS:
> - elf_aarch64_tdata (output_bfd)->gnu_property_aarch64_feature_1_and
> - |= GNU_PROPERTY_AARCH64_FEATURE_1_GCS;
> + gnu_property_aarch64_feature_1_and |= GNU_PROPERTY_AARCH64_FEATURE_1_GCS;
> +
> + /* The default diagnostic level with '-z gcs=always' is 'warning'. */
> + if (sw_protections->gcs_report == MARKING_UNSET)
> + gcs_report = MARKING_WARN;
> + else
> + gcs_report = sw_protections->gcs_report;
> +
> + /* The default diagnostic level with '-z gcs=always' is 'warning'. */
> + if (sw_protections->gcs_report_dynamic == MARKING_UNSET)
> + gcs_report_dynamic = MARKING_WARN;
> + else
> + gcs_report_dynamic = sw_protections->gcs_report_dynamic;
> break;
> +
> case GCS_NEVER:
> - elf_aarch64_tdata (output_bfd)->gnu_property_aarch64_feature_1_and
> - &= ~GNU_PROPERTY_AARCH64_FEATURE_1_GCS;
> + gnu_property_aarch64_feature_1_and &= ~GNU_PROPERTY_AARCH64_FEATURE_1_GCS;
> +
> + /* Markings are ignored, so no diagnostic messages can be emitted. */
> + gcs_report = MARKING_NONE;
> + gcs_report_dynamic = MARKING_NONE;
> break;
> +
> case GCS_IMPLICIT:
> /* GCS feature on the output bfd will be deduced from input objects. */
> +
> + /* No warnings should be emitted on input static objects with
> + '-z gcs=implicit'. */
> + gcs_report = MARKING_NONE;
> +
> + /* Binary Linux distributions do not rebuild all packages from scratch
> + when rolling out a new feature or creating a new release; only modified
> + packages get rebuilt. In the context of GCS deployment, this meant
> + that some packages were rebuilt with GCS enabled while their
> + dependencies were not yet GCS-compatible, resulting in warnings because
> + originally the report level for dynamic objects was set to warning.
> + These warnings caused build failures for packages that treat linker
> + warnings as errors. Those errors slowed down the GCS deployment, and
> + Linux distribution maintainers requested that no GCS option provided
> + should be equivalent to '-z gcs=implicit -z gcs-report-dynamic=none'.
> + */
> + if (sw_protections->gcs_report_dynamic == MARKING_UNSET)
> + gcs_report_dynamic = MARKING_NONE;
> + else
> + gcs_report_dynamic = sw_protections->gcs_report_dynamic;
> break;
> }
>
> + elf_aarch64_tdata (output_bfd)->gnu_property_aarch64_feature_1_and
> + = gnu_property_aarch64_feature_1_and;
> +
> elf_aarch64_tdata (output_bfd)->sw_protections = *sw_protections;
> - /* Inherit the value from '-z gcs-report' if the option '-z gcs-report-dynamic'
> - was not set on the command line. However, the inheritance mechanism is
> - capped to avoid inheriting the error level from -g gcs-report as the user
> - might want to continue to build a module without rebuilding all the shared
> - libraries. If a user also wants to error GCS issues in the shared
> - libraries, '-z gcs-report-dynamic=error' will have to be specified
> - explicitly. */
> - if (sw_protections->gcs_report_dynamic == MARKING_UNSET)
> - elf_aarch64_tdata (output_bfd)->sw_protections.gcs_report_dynamic
> - = (sw_protections->gcs_report == MARKING_ERROR)
> - ? MARKING_WARN
> - : sw_protections->gcs_report;
> + /* Adjusting GCS diagnostic levels. */
> + elf_aarch64_tdata (output_bfd)->sw_protections.gcs_report
> + = gcs_report;
> + elf_aarch64_tdata (output_bfd)->sw_protections.gcs_report_dynamic
> + = gcs_report_dynamic;
>
> elf_aarch64_tdata (output_bfd)->n_bti_issues = 0;
> elf_aarch64_tdata (output_bfd)->n_gcs_issues = 0;
> diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
> index e15eb432458..ca7342b8447 100644
> --- a/ld/emultempl/aarch64elf.em
> +++ b/ld/emultempl/aarch64elf.em
> @@ -38,7 +38,7 @@ static aarch64_protection_opts sw_protections = {
> .plt_type = PLT_NORMAL,
> .bti_report = MARKING_WARN,
> .gcs_type = GCS_IMPLICIT,
> - .gcs_report = MARKING_WARN,
> + .gcs_report = MARKING_UNSET,
> .gcs_report_dynamic = MARKING_UNSET,
> };
>
> @@ -417,7 +417,7 @@ aarch64_parse_gcs_report_dynamic_option (const char *_optarg)
> #define GCS_REPORT_DYNAMIC_LEN COMPILE_TIME_STRLEN (GCS_REPORT_DYNAMIC)
>
> return aarch64_parse_feature_report_option (_optarg, GCS_REPORT_DYNAMIC,
> - GCS_REPORT_DYNAMIC_LEN, false, &sw_protections.gcs_report_dynamic);
> + GCS_REPORT_DYNAMIC_LEN, true, &sw_protections.gcs_report_dynamic);
>
> #undef GCS_REPORT_DYNAMIC
> #undef GCS_REPORT_DYNAMIC_LEN
> diff --git a/ld/ld.texi b/ld/ld.texi
> index 1ec56c08337..e4cc5b4aa99 100644
> --- a/ld/ld.texi
> +++ b/ld/ld.texi
> @@ -8370,43 +8370,35 @@ markings on input objects and marks the output with GCS if all conditions are
> validated.
> @itemize
> @item @samp{implicit} (default if @samp{-z gcs} is omitted) enables GCS marking
> -on the output if, and only if, all input objects composing the link unit are
> -marked with GCS.
> +on the output if, and only if, all input static objects are marked with GCS.
> @item @samp{always} forces the marking of the output with GCS.
> @item @samp{never} ignores any GCS marking on the input objects, and does not
> mark the output with GCS.
> @end itemize
>
> @kindex -z gcs-report[=none|warning|error]
> -@cindex Control warnings for missing GCS markings.
> -The @samp{-z gcs-report[=none|warning|error]} option specifies how to report the
> -missing GCS markings on inputs, i.e. the GNU_PROPERTY_AARCH64_FEATURE_1_GCS
> -property. By default, if the option is omitted and @samp{-z gcs} is provided,
> -warnings are emitted.
> +@cindex Control diagnostics for missing GCS markings on static input objects.
> +When @samp{-z gcs=always} is specified, then the @samp{-z gcs-report[=none|warning|error]}
> +option can be used to specify how to report missing GCS markings (i.e.
> +the GNU_PROPERTY_AARCH64_FEATURE_1_GCS property) on static inputs.
> @itemize
> -@item @samp{none} disables any warning messages.
> -@item @samp{warning} (the default value) emits warning messages when input objects
> -composing the link unit are missing GCS markings.
> -@item @samp{error} turns the warning messages into errors.
> +@item @samp{none} disables the diagnostic messages.
> +@item @samp{warning} (the default value) emits diagnostic messages as warnings.
> +@item @samp{error} emits diagnostic messages as errors.
> @end itemize
> If issues are found, a maximum of 20 messages will be emitted, and then a summary
> with the total number of issues will be displayed at the end.
>
> -@kindex -z gcs-report-dynamic=none|warning|error
> -@cindex Control warnings for missing GCS markings on dynamic input objects.
> -The @samp{-z gcs-report-dynamic=none|warning|error} option specifies how to
> -report the missing GCS markings on dynamic input objects, i.e. the
> -GNU_PROPERTY_AARCH64_FEATURE_1_GCS property. By default, if the option is
> -omitted, it inherits the value of @samp{-z gcs-report}. However, the inherited
> -value is capped to @samp{warning} as some user might want to only report errors
> -in the currently built module, and not the shared dependencies. It is therefore
> -necessary to use an explicit @samp{-z gcs-report-dynamic=error} option if you
> -want the linker to error on GCS issues in the shared libraries.
> +@kindex -z gcs-report-dynamic[=none|warning|error]
> +@cindex Control diagnostics for missing GCS markings on dynamic input objects.
> +If @samp{-z gcs} is not specified on the command line, or if it has the value
> +@samp{implicit} or @samp{always}, then the @samp{-z gcs-report-dynamic[=none|warning|error]}
> +option specifies how to report the missing GCS markings (i.e. the GNU_PROPERTY_AARCH64_FEATURE_1_GCS
> +property) on dynamic input objects.
> @itemize
> -@item @samp{none} disables any warning messages.
> -@item @samp{warning} emits warning messages when dynamic objects are missing
> -GCS markings.
> -@item @samp{error} turns the warning messages into errors.
> +@item @samp{none} (default value when @samp{-z gcs=implicit}) disables the diagnostic messages.
> +@item @samp{warning} (default value when @samp{-z gcs=always}) emits diagnostic messages as warnings.
> +@item @samp{error} emits diagnostic messages as errors.
> @end itemize
> If issues are found, a maximum of 20 messages will be emitted, and then a summary
> with the total number of issues will be displayed at the end.
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-1-c.d b/ld/testsuite/ld-aarch64/protections/gcs-1-c.d
> index 8205832f524..15db497528f 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-1-c.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-1-c.d
> @@ -1,4 +1,4 @@
> -#name: Specifying '-z gcs' without value raise an error
> +#name: '-z gcs' without value raises an error
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-1-d.d b/ld/testsuite/ld-aarch64/protections/gcs-1-d.d
> index 736330375fa..28198da708d 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-1-d.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-1-d.d
> @@ -1,4 +1,4 @@
> -#name: Specifying invalid value for '-z gcs' raise an error
> +#name: Invalid value for '-z gcs' raises an error
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-2-a-i.d b/ld/testsuite/ld-aarch64/protections/gcs-2-a-i.d
> index 77711ea0a58..536687e7cf8 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-2-a-i.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-2-a-i.d
> @@ -1,4 +1,4 @@
> -#name: Specifying only '-z gcs=always' with GCS marked inputs emits GCS feature without warnings for inputs with GCS feature [shared]
> +#name: '-z gcs=always' with GCS-marked inputs emits GCS feature and no warnings [shared]
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-2-a-ii.d b/ld/testsuite/ld-aarch64/protections/gcs-2-a-ii.d
> index 04094a9036c..ef2c41d4dd7 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-2-a-ii.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-2-a-ii.d
> @@ -1,4 +1,4 @@
> -#name: Specifying only '-z gcs=always' emits GCS feature with warnings for missing GCS feature on inputs [shared]
> +#name: '-z gcs=always' with GCS-unmarked inputs emits GCS feature with warnings [shared]
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-2-b-i.d b/ld/testsuite/ld-aarch64/protections/gcs-2-b-i.d
> index cecf2742495..424e35a208b 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-2-b-i.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-2-b-i.d
> @@ -1,4 +1,4 @@
> -#name: Specifying only '-z gcs=implicit' and GCS-marked inputs emits GCS feature [shared]
> +#name: '-z gcs=implicit' with GCS-marked inputs emits GCS feature [shared]
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-2-b-ii.d b/ld/testsuite/ld-aarch64/protections/gcs-2-b-ii.d
> index 853629935bb..1e9c5992667 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-2-b-ii.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-2-b-ii.d
> @@ -1,4 +1,4 @@
> -#name: Specifying only '-z gcs=implicit' and GCS-unmarked inputs emits no GCS feature without warnings [shared]
> +#name: '-z gcs=implicit' with GCS-unmarked inputs emits no GCS feature and no warnings [shared]
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-2-b-iii.d b/ld/testsuite/ld-aarch64/protections/gcs-2-b-iii.d
> index b49e7c4d7ac..91c3a290077 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-2-b-iii.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-2-b-iii.d
> @@ -1,12 +1,7 @@
> -#name: Specifying only '-z gcs=implicit -z gcs-report=warning' and GCS-marked inputs emits GCS feature [shared]
> +#name: '-z gcs=implicit -z gcs-report=warning' with GCS-unmarked inputs emits no warnings [shared]
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> -#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> +#as: -march=armv9.4-a+gcs
> #ld: -shared -z gcs=implicit -z gcs-report=warning
> #readelf: -n
> -
> -Displaying notes found in: .note.gnu.property
> -[ ]+Owner[ ]+Data size[ ]+Description
> - GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
> - Properties: AArch64 feature: GCS
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-2-b-iv.d b/ld/testsuite/ld-aarch64/protections/gcs-2-b-iv.d
> deleted file mode 100644
> index c98f3e0525a..00000000000
> --- a/ld/testsuite/ld-aarch64/protections/gcs-2-b-iv.d
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -#name: Specifying only '-z gcs=implicit -z gcs-report=warning' and GCS-unmarked inputs emits no GCS feature without warnings [shared]
> -#source: gcs.s
> -#source: gcs2.s
> -#alltargets: [check_shared_lib_support] *linux*
> -#as: -march=armv9.4-a+gcs
> -#ld: -shared -z gcs=implicit -z gcs-report=warning
> -#readelf: -n
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-2-c-i.d b/ld/testsuite/ld-aarch64/protections/gcs-2-c-i.d
> index 4bf8f6cbc16..644b7ce35cb 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-2-c-i.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-2-c-i.d
> @@ -1,4 +1,4 @@
> -#name: Specifying only '-z gcs=never' and GCS-marked inputs emits no GCS feature [shared]
> +#name: '-z gcs=never' with GCS-marked inputs emits no GCS feature [shared]
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-2-c-ii.d b/ld/testsuite/ld-aarch64/protections/gcs-2-c-ii.d
> index 6941233cb6c..d4438e9d44b 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-2-c-ii.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-2-c-ii.d
> @@ -1,4 +1,4 @@
> -#name: Specifying only '-z gcs=never' and GCS-unmarked inputs emits no GCS feature [shared]
> +#name: '-z gcs=never' with GCS-unmarked inputs emits no GCS feature [shared]
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-3-c-ii.d b/ld/testsuite/ld-aarch64/protections/gcs-2-c-iii.d
> similarity index 58%
> rename from ld/testsuite/ld-aarch64/protections/gcs-3-c-ii.d
> rename to ld/testsuite/ld-aarch64/protections/gcs-2-c-iii.d
> index bbe5e1092c5..4fc4df9c144 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-3-c-ii.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-2-c-iii.d
> @@ -1,8 +1,8 @@
> -#name: Specifying only '-z gcs=never -z gcs-report=warning' with mixed inputs emits no error/warning, and no GCS feature [shared]
> +#name: '-z gcs=never -z gcs-report=warning' with mixed inputs emits no warnings [shared]
> #source: gcs.s
> #source: gcs2.s
> #source: nogcs.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> #ld: -shared -z gcs=never -z gcs-report=warning
> -#readelf: -n
> \ No newline at end of file
> +#readelf: -n
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-3-a-i.d b/ld/testsuite/ld-aarch64/protections/gcs-3-a-i.d
> index c1c5ba3e126..f9b01b93465 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-3-a-i.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-3-a-i.d
> @@ -1,4 +1,4 @@
> -#name: Specifying only '-z gcs=always -z gcs-report=error' with mixed inputs emits errors [shared]
> +#name: '-z gcs=always -z gcs-report=error' with mixed inputs emits errors [shared]
> #source: gcs.s
> #source: gcs2.s
> #source: nogcs.s
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-3-a-ii.d b/ld/testsuite/ld-aarch64/protections/gcs-3-a-ii.d
> index d7289be30cf..0282a2e995e 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-3-a-ii.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-3-a-ii.d
> @@ -1,4 +1,4 @@
> -#name: Specifying only '-z gcs=always -z gcs-report=warning' with mixed inputs emits GCS feature and warnings [shared]
> +#name: '-z gcs=always -z gcs-report=warning' with mixed inputs emits GCS feature and warnings [shared]
> #source: gcs.s
> #source: gcs2.s
> #source: nogcs.s
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-3-a-iii.d b/ld/testsuite/ld-aarch64/protections/gcs-3-a-iii.d
> index 5f55e2f16fc..3d3c854b6d6 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-3-a-iii.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-3-a-iii.d
> @@ -1,4 +1,4 @@
> -#name: Specifying only '-z gcs=always -z gcs-report=none' with mixed inputs emits GCS feature and no error/warning [shared]
> +#name: '-z gcs=always -z gcs-report=none' with mixed inputs emits GCS feature and no diagnostics [shared]
> #source: gcs.s
> #source: gcs2.s
> #source: nogcs.s
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-3-a-iv.d b/ld/testsuite/ld-aarch64/protections/gcs-3-a-iv.d
> index 5c340c40064..0b5d1118634 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-3-a-iv.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-3-a-iv.d
> @@ -1,4 +1,4 @@
> -#name: Specifying only '-z gcs=always -z gcs-report' with mixed inputs emits GCS feature and warnings [shared]
> +#name: '-z gcs=always -z gcs-report' with mixed inputs emits GCS feature and warnings [shared]
> #source: gcs.s
> #source: gcs2.s
> #source: nogcs.s
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-3-b-i.d b/ld/testsuite/ld-aarch64/protections/gcs-3-b-i.d
> deleted file mode 100644
> index 70cc1bd7c15..00000000000
> --- a/ld/testsuite/ld-aarch64/protections/gcs-3-b-i.d
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -#name: Specifying only '-z gcs=implicit -z gcs-report=error' with mixed inputs emits no error/warning, and no GCS feature [shared]
> -#source: gcs.s
> -#source: gcs2.s
> -#source: nogcs.s
> -#alltargets: [check_shared_lib_support] *linux*
> -#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -shared -z gcs=implicit -z gcs-report=error
> -#readelf: -n
> \ No newline at end of file
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-3-b-ii.d b/ld/testsuite/ld-aarch64/protections/gcs-3-b-ii.d
> deleted file mode 100644
> index f03e7ef7feb..00000000000
> --- a/ld/testsuite/ld-aarch64/protections/gcs-3-b-ii.d
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -#name: Specifying only '-z gcs=implicit -z gcs-report=warning' with mixed inputs emits no warning, and no GCS feature [shared]
> -#source: gcs.s
> -#source: gcs2.s
> -#source: nogcs.s
> -#alltargets: [check_shared_lib_support] *linux*
> -#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -shared -z gcs=implicit -z gcs-report=warning
> -#readelf: -n
> \ No newline at end of file
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-3-b-iii.d b/ld/testsuite/ld-aarch64/protections/gcs-3-b-iii.d
> deleted file mode 100644
> index 3d3e07cb310..00000000000
> --- a/ld/testsuite/ld-aarch64/protections/gcs-3-b-iii.d
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -#name: Specifying only '-z gcs=implicit -z gcs-report=none' with mixed inputs emits no warning, and no GCS feature [shared]
> -#source: gcs.s
> -#source: gcs2.s
> -#source: nogcs.s
> -#alltargets: [check_shared_lib_support] *linux*
> -#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -shared -z gcs=implicit -z gcs-report=none
> -#readelf: -n
> \ No newline at end of file
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-3-c-i.d b/ld/testsuite/ld-aarch64/protections/gcs-3-c-i.d
> deleted file mode 100644
> index 472bb656d9e..00000000000
> --- a/ld/testsuite/ld-aarch64/protections/gcs-3-c-i.d
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -#name: Specifying only '-z gcs=never -z gcs-report=error' with mixed inputs emits no error/warning, and no GCS feature [shared]
> -#source: gcs.s
> -#source: gcs2.s
> -#source: nogcs.s
> -#alltargets: [check_shared_lib_support] *linux*
> -#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -shared -z gcs=never -z gcs-report=error
> -#readelf: -n
> \ No newline at end of file
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-3-c-iii.d b/ld/testsuite/ld-aarch64/protections/gcs-3-c-iii.d
> deleted file mode 100644
> index 6bf96bc9985..00000000000
> --- a/ld/testsuite/ld-aarch64/protections/gcs-3-c-iii.d
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -#name: Specifying only '-z gcs=never -z gcs-report=none' with mixed inputs emits no error/warning, and no GCS feature [shared]
> -#source: gcs.s
> -#source: gcs2.s
> -#source: nogcs.s
> -#alltargets: [check_shared_lib_support] *linux*
> -#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -shared -z gcs=never -z gcs-report=none
> -#readelf: -n
> \ No newline at end of file
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-a.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-a.d
> index be8a301f6c0..b8358c55f8a 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-a.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-a.d
> @@ -1,9 +1,9 @@
> -#name: '-z gcs=always -z gcs-report=error' and shared library with GCS feature reports no error.
> +#name: '-z gcs=always' with GCS-marked shared library reports nothing.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=always -z gcs-report=error -L./tmpdir -lgcs-so
> +#ld: -z gcs=always -L./tmpdir -lgcs-so
> #readelf: -n
>
> Displaying notes found in: .note.gnu.property
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-b.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-b.d
> index d53d45ae598..51a35412e84 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-b.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-b.d
> @@ -1,4 +1,4 @@
> -#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=error' and shared library with GCS feature reports no error.
> +#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=error' with GCS-marked shared library reports nothing.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-ii.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-ii.d
> deleted file mode 100644
> index 7adb481bc30..00000000000
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-ii.d
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=error' and shared libraries without GCS feature reports errors.
> -#source: gcs.s
> -#source: gcs2.s
> -#alltargets: [check_shared_lib_support] *linux*
> -#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=always -z gcs-report=error -z gcs-report-dynamic=error -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> -#error: \A[^\n]*libnogcs-so\.so: error: GCS is required by -z gcs[^\n]*\n
> -#error: [^\n]*libbti-plt-so\.so: error: GCS is required by -z gcs[^\n]*
> \ No newline at end of file
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-i.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a.d
> similarity index 84%
> rename from ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-i.d
> rename to ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a.d
> index 903d14099be..9623b5f498c 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-i.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a.d
> @@ -1,4 +1,4 @@
> -#name: '-z gcs=always -z gcs-report=error' and shared libraries without GCS feature reports warnings.
> +#name: '-z gcs=always' with GCS-unmarked shared libraries reports warnings.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-b.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-b.d
> index 36262bbc087..9750569400d 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-b.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-b.d
> @@ -1,14 +1,8 @@
> -#name: '-z gcs=always -z gcs-report=warning' and shared libraries without GCS feature reports warnings.
> +#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=error' with GCS-unmarked shared libraries reports errors.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=always -z gcs-report=warning -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> -#warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n
> -#warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]*
> -#readelf: -n
> -
> -Displaying notes found in: .note.gnu.property
> -[ ]+Owner[ ]+Data size[ ]+Description
> - GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
> - Properties: AArch64 feature: GCS
> +#ld: -z gcs=always -z gcs-report=error -z gcs-report-dynamic=error -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> +#error: \A[^\n]*libnogcs-so\.so: error: GCS is required by -z gcs[^\n]*\n
> +#error: [^\n]*libbti-plt-so\.so: error: GCS is required by -z gcs[^\n]*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-c.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-c.d
> index 6c7f5da8be7..c142f690262 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-c.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-c.d
> @@ -1,9 +1,12 @@
> -#name: '-z gcs=always -z gcs-report=none' and shared libraries without GCS feature reports nothing.
> +#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=warning' with GCS-unmarked shared libraries reports warnings.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=always -z gcs-report=none -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> +#ld: -z gcs=always -z gcs-report=error -z gcs-report-dynamic=warning -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> +#warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n
> +#warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]*
> +
> #readelf: -n
>
> Displaying notes found in: .note.gnu.property
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-d.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-d.d
> index 58498e6c00b..dee840d533c 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-d.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-d.d
> @@ -1,11 +1,9 @@
> -#name: '-z gcs=always -z gcs-report' and shared libraries without GCS feature reports warnings.
> +#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=none' with GCS-unmarked shared libraries reports nothing.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=always -z gcs-report -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> -#warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n
> -#warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]*
> +#ld: -z gcs=always -z gcs-report=error -z gcs-report-dynamic=none -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> #readelf: -n
>
> Displaying notes found in: .note.gnu.property
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-a.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-a.d
> index ecdaf526779..471bebe642e 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-a.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-a.d
> @@ -1,15 +1,8 @@
> -#name: '-z gcs=implicit -z gcs-report=error' and shared libraries without GCS feature reports warnings.
> +#name: '-z gcs=implicit -z gcs-report-dynamic=error' with GCS-unmarked shared libraries reports errors.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=implicit -z gcs-report=error -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> -#warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n
> -#warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]*
> -
> -#readelf: -n
> -
> -Displaying notes found in: .note.gnu.property
> -[ ]+Owner[ ]+Data size[ ]+Description
> - GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
> - Properties: AArch64 feature: GCS
> +#ld: -z gcs=implicit -z gcs-report-dynamic=error -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> +#error: \A[^\n]*libnogcs-so\.so: error: GCS is required by -z gcs[^\n]*\n
> +#error: [^\n]*libbti-plt-so\.so: error: GCS is required by -z gcs[^\n]*
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-b.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-b.d
> index 4d32fb6aa54..5ed6616df3e 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-b.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-b.d
> @@ -1,9 +1,9 @@
> -#name: '-z gcs=implicit -z gcs-report=warning' and shared libraries without GCS feature reports warnings.
> +#name: '-z gcs=implicit -z gcs-report-dynamic=warning' with GCS-unmarked shared libraries reports warnings.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=implicit -z gcs-report=warning -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> +#ld: -z gcs=implicit -z gcs-report-dynamic=warning -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> #warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n
> #warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]*
> #readelf: -n
> @@ -11,4 +11,4 @@
> Displaying notes found in: .note.gnu.property
> [ ]+Owner[ ]+Data size[ ]+Description
> GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
> - Properties: AArch64 feature: GCS
> \ No newline at end of file
> + Properties: AArch64 feature: GCS
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-c.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-c.d
> index c0da6c1d9c6..5f2be116753 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-c.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-c.d
> @@ -1,12 +1,12 @@
> -#name: '-z gcs=implicit -z gcs-report=none' and shared libraries without GCS feature reports no warning.
> +#name: '-z gcs=implicit -z gcs-report-dynamic=none' with GCS-unmarked shared libraries reports nothing.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=implicit -z gcs-report=none -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> +#ld: -z gcs=implicit -z gcs-report-dynamic=none -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> #readelf: -n
>
> Displaying notes found in: .note.gnu.property
> [ ]+Owner[ ]+Data size[ ]+Description
> GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
> - Properties: AArch64 feature: GCS
> \ No newline at end of file
> + Properties: AArch64 feature: GCS
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iv.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-d.d
> similarity index 51%
> rename from ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iv.d
> rename to ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-d.d
> index 554ca1186ef..70f8845c9e3 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iv.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-d.d
> @@ -1,12 +1,12 @@
> -#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=none' and shared libraries without GCS feature reports nothing.
> +#name: '-z gcs=implicit' and GCS-unmarked shared libraries reports nothing.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=always -z gcs-report=error -z gcs-report-dynamic=none -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> +#ld: -z gcs=implicit -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> #readelf: -n
>
> Displaying notes found in: .note.gnu.property
> [ ]+Owner[ ]+Data size[ ]+Description
> GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
> - Properties: AArch64 feature: GCS
> \ No newline at end of file
> + Properties: AArch64 feature: GCS
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-e.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-e.d
> new file mode 100644
> index 00000000000..8781123b749
> --- /dev/null
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-e.d
> @@ -0,0 +1,12 @@
> +#name: Linux distributions's main use case: no GCS options and GCS-unmarked shared libraries report nothing.
> +#source: gcs.s
> +#source: gcs2.s
> +#alltargets: [check_shared_lib_support] *linux*
> +#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> +#ld: -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> +#readelf: -n
> +
> +Displaying notes found in: .note.gnu.property
> +[ ]+Owner[ ]+Data size[ ]+Description
> + GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
> + Properties: AArch64 feature: GCS
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iii.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-f.d
> similarity index 61%
> rename from ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iii.d
> rename to ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-f.d
> index 76a7c461347..18d4350c5e7 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iii.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-f.d
> @@ -1,15 +1,14 @@
> -#name: '-z gcs=always -z gcs-report=error -z gcs-report-dynamic=warning' and shared libraries without GCS feature reports warnings.
> +#name: '-z gcs-report-dynamic' with GCS-unmarked shared libraries reports warnings.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=always -z gcs-report=error -z gcs-report-dynamic=warning -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> +#ld: -z gcs-report-dynamic -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> #warning: \A[^\n]*libnogcs-so\.so: warning: GCS is required by -z gcs[^\n]*\n
> #warning: [^\n]*libbti-plt-so\.so: warning: GCS is required by -z gcs[^\n]*
> -
> #readelf: -n
>
> Displaying notes found in: .note.gnu.property
> [ ]+Owner[ ]+Data size[ ]+Description
> GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
> - Properties: AArch64 feature: GCS
> \ No newline at end of file
> + Properties: AArch64 feature: GCS
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-a.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-a.d
> index ae324bbba1e..5c73a2920de 100644
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-a.d
> +++ b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-a.d
> @@ -1,7 +1,7 @@
> -#name: '-z gcs=never -z gcs-report=error' and shared libraries without GCS feature reports no warning/error.
> +#name: '-z gcs=never -z gcs-report-dynamic=error' with GCS-unmarked shared libraries reports nothing.
> #source: gcs.s
> #source: gcs2.s
> #alltargets: [check_shared_lib_support] *linux*
> #as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=never -z gcs-report=error -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> +#ld: -z gcs=never -z gcs-report-dynamic=error -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> #readelf: -n
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-b.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-b.d
> deleted file mode 100644
> index 6b65898b924..00000000000
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-b.d
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -#name: '-z gcs=never -z gcs-report=warning' and shared libraries without GCS feature reports no warning/error.
> -#source: gcs.s
> -#source: gcs2.s
> -#alltargets: [check_shared_lib_support] *linux*
> -#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=never -z gcs-report=warning -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> -#readelf: -n
> diff --git a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-c.d b/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-c.d
> deleted file mode 100644
> index 35b011f6a8e..00000000000
> --- a/ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-c.d
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -#name: '-z gcs=never -z gcs-report=none' and shared libraries without GCS feature reports no warning/error.
> -#source: gcs.s
> -#source: gcs2.s
> -#alltargets: [check_shared_lib_support] *linux*
> -#as: -march=armv9.4-a+gcs -defsym __property_gcs__=1
> -#ld: -z gcs=never -z gcs-report=none -L./tmpdir -lnogcs-so -lbti-plt-so -lgcs-so2
> -#readelf: -n
> --
> 2.52.0
>
More information about the Binutils
mailing list