]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
aarch64: silence GCS warnings on shared libraries for -z gcs=implicit
authorMatthieu Longo <matthieu.longo@arm.com>
Thu, 4 Dec 2025 15:50:30 +0000 (15:50 +0000)
committerMatthieu Longo <matthieu.longo@arm.com>
Wed, 21 Jan 2026 12:49:19 +0000 (12:49 +0000)
commit88bd7bd086231a2c2cd84f94bb0c698075791e35
tree471db6ed1c74df74a4685c69e710a4b866309b82
parent7fe76e039e0cd0c444b86506cfaa050d9d1cb99a
aarch64: silence GCS warnings on shared libraries for -z gcs=implicit

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.
40 files changed:
bfd/elfnn-aarch64.c
ld/emultempl/aarch64elf.em
ld/ld.texi
ld/testsuite/ld-aarch64/protections/gcs-1-c.d
ld/testsuite/ld-aarch64/protections/gcs-1-d.d
ld/testsuite/ld-aarch64/protections/gcs-1-e.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/protections/gcs-2-a-i.d
ld/testsuite/ld-aarch64/protections/gcs-2-a-ii.d
ld/testsuite/ld-aarch64/protections/gcs-2-b-i.d
ld/testsuite/ld-aarch64/protections/gcs-2-b-ii.d
ld/testsuite/ld-aarch64/protections/gcs-2-b-iii.d
ld/testsuite/ld-aarch64/protections/gcs-2-b-iv.d
ld/testsuite/ld-aarch64/protections/gcs-2-b-v.d [moved from ld/testsuite/ld-aarch64/protections/gcs-3-b-ii.d with 58% similarity]
ld/testsuite/ld-aarch64/protections/gcs-2-c-i.d
ld/testsuite/ld-aarch64/protections/gcs-2-c-ii.d
ld/testsuite/ld-aarch64/protections/gcs-2-c-iii.d [moved from ld/testsuite/ld-aarch64/protections/gcs-3-c-ii.d with 58% similarity]
ld/testsuite/ld-aarch64/protections/gcs-3-a-i.d
ld/testsuite/ld-aarch64/protections/gcs-3-a-ii.d
ld/testsuite/ld-aarch64/protections/gcs-3-a-iii.d
ld/testsuite/ld-aarch64/protections/gcs-3-a-iv.d
ld/testsuite/ld-aarch64/protections/gcs-3-b-i.d [deleted file]
ld/testsuite/ld-aarch64/protections/gcs-3-b-iii.d [deleted file]
ld/testsuite/ld-aarch64/protections/gcs-3-c-i.d [deleted file]
ld/testsuite/ld-aarch64/protections/gcs-3-c-iii.d [deleted file]
ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-a.d
ld/testsuite/ld-aarch64/protections/gcs-dynamic-1-b.d
ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-ii.d [deleted file]
ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a.d [moved from ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-i.d with 84% similarity]
ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-b.d
ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-c.d
ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-d.d
ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-a.d
ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-b.d
ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-c.d
ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-d.d [moved from ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iv.d with 51% similarity]
ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-e.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/protections/gcs-dynamic-3-f.d [moved from ld/testsuite/ld-aarch64/protections/gcs-dynamic-2-a-iii.d with 61% similarity]
ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-a.d
ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-b.d [deleted file]
ld/testsuite/ld-aarch64/protections/gcs-dynamic-4-c.d [deleted file]