]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
aarch64: Add support for GCS to AArch64 linker users/ARM/gcs
authorSrinath Parvathaneni <srinath.parvathaneni@arm.com>
Wed, 16 Oct 2024 14:42:08 +0000 (15:42 +0100)
committerAndre Vieira <andre.simoesdiasvieira@arm.com>
Wed, 16 Oct 2024 14:47:13 +0000 (15:47 +0100)
commit8d59fa447f688b7863a5b3e6af5015e36c7f0024
tree7620b9253ea8b3dc830cc2ad7b4ba78de9459265
parenta9ed7a0814fc70feaad485576d043a983b6f8695
aarch64: Add support for GCS to AArch64 linker

This patch adds support for Guarded Control Stack in AArch64 linker.

This patch implements the following:
1) Defines GNU_PROPERTY_AARCH64_FEATURE_1_GCS bit for GCS in
GNU_PROPERTY_AARCH64_FEATURE_1_AND macro.

2) Adds readelf support to read and print the GNU properties
in AArch64.

Displaying notes found in: .note.gnu.property
[      ]+Owner[        ]+Data size[    ]+Description
  GNU                  0x00000010      NT_GNU_PROPERTY_TYPE_0
      Properties: AArch64 feature: GCS

3) Adds support for the "-z gcs" linker option and document all the values
allowed with this option (-z gcs[=always|never|implicit]) where "-z gcs" is
equivalent to "-z gcs=always" and when this option is not passed in the
command line, it defaults to "implicit".

4) Adds support for the "-z gcs-report" linker option and document all the
values allowed with this option (-z gcs-report[=none|warning|error]) where
"-z gcs-report" is equivalent to "-z gcs-report=none" and when this option
is not passed in the command line, it defaults to "none".

The ABI changes adding GNU_PROPERTY_AARCH64_FEATURE_1_GCS to the
GNU property GNU_PROPERTY_AARCH64_FEATURE_1_AND is merged into main and
can be found in [1].

[1] https://github.com/ARM-software/abi-aa/blob/main/sysvabi64/sysvabi64.rst

Co-authored-by: Matthieu Longo <matthieu.longo@arm.com>
Co-authored-by: Yury Khrustalev <yury.khrustalev@arm.com>
33 files changed:
bfd/elfnn-aarch64.c
bfd/elfxx-aarch64.c
bfd/elfxx-aarch64.h
binutils/readelf.c
include/elf/common.h
ld/emultempl/aarch64elf.em
ld/testsuite/ld-aarch64/aarch64-elf.exp
ld/testsuite/ld-aarch64/property-bti-pac1.d
ld/testsuite/ld-aarch64/property-bti-pac1.s
ld/testsuite/ld-aarch64/property-gcs.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs1.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs10.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs11.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs12.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs13.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs14.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs15.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs16.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs17.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs18.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs19.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs2.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs2.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs20.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs21.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs22.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs3.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs4.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs5.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs6.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs7.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs8.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/property-gcs9.d [new file with mode: 0644]