Matthieu Longo <matthieu.lo...@arm.com> writes: > GCS (Guarded Control Stack, an Armv9.4-a extension) requires some caution at > runtime. The runtime linker needs to reason about the compatibility of a set > of relocable object files that might not have been compiled with the same > compiler. Up until now, those metadata, used for the previously mentioned > runtime checks, have been provided to the runtime linker via GNU properties > which are stored in the ELF section ".note.gnu.property". > However, GNU properties are limited in their expressibility, and a long-term > commmitment was taken in the ABI for the Arm architecture [1] to provide > Build Attributes (a.k.a. BAs). > > The series is composed of the following two patches: > 1. A refactoring of the code emitting GNU properties. > 2. The patch adding support for AEABI Build Attributes [1] in the context of > GCS (Guarded Control Stack, an Armv9.4-a extension) to the AArch64 backend. > > **Special note regarding (2):** > If Gas has support for build attributes, GCC will only emit Build Attributes. > Then the GNU linker will translate the Build Attributes to GNU properties, > and both of them will be stored into the output object. > > Bootstrapped on aarch64-none-linux-gnu, and no regression found.
OK for the series, thanks. Richard > Regards, > Matthieu > > ## References > > - [1]: [Build Attributes for the ArmĀ® 64-bit Architecture > (AArch64)](https://github.com/ARM-software/abi-aa/blob/eec881270d5e3b23e58a6250640d06ff545ec1fc/buildattr64/buildattr64.rst) > - [2]: https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662825.html > - [3]: https://gcc.gnu.org/pipermail/gcc-patches/2024-September/664004.html > - [4]: https://gcc.gnu.org/pipermail/gcc-patches/2024-October/666178.html > - [5]: > https://inbox.sourceware.org/gcc-patches/20250604150612.1234394-1-matthieu.lo...@arm.com/ > > ## Previous revisions > > Diff with revision 4 [5]: > - address the comments from Richard Sandiford. > - rename aarch64-dwarf-metadata.[cc|h] to aarch64-elf-metadata.[cc|h] > - add BACKEND_H as a dependency of aarch64-elf-metadata.h > - Makefile.in: add missing declaration of BACKEND_H > - patch 1 was merged into master. > > Diff with revision 3 [4]: > - align the implementation with the latest revision of the AEABI Build > Attributes specifications. > - reorganize the series so that the two refactoring patches related to GNU > properties are coming first, and can be merged earlier. > - merge the two previous patches implementing the BAs into one. > > Diff with revision 2 [3]: > - address comments of Richard Sandiford in revision 2. > - fix several formatting mistakes. > - remove RFC tag. > > Diff with revision 1 [2]: > - update the description of (2) > - address the comments related to the tests in (2) > - add new commits (1), (3) and (4) > > > Matthieu Longo (2): > aarch64: encapsulate note.gnu.property emission into a class > aarch64: add support for AEABI Build Attributes > > gcc/Makefile.in | 4 +- > gcc/config.gcc | 2 +- > gcc/config.in | 6 + > gcc/config/aarch64/aarch64-elf-metadata.cc | 145 ++++++++++ > gcc/config/aarch64/aarch64-elf-metadata.h | 253 ++++++++++++++++++ > gcc/config/aarch64/aarch64-protos.h | 1 + > gcc/config/aarch64/aarch64.cc | 111 +++----- > gcc/config/aarch64/t-aarch64 | 11 + > gcc/configure | 37 +++ > gcc/configure.ac | 9 + > .../aarch64-build-attributes.exp | 35 +++ > .../build-attributes/build-attribute-bti.c | 11 + > .../build-attributes/build-attribute-gcs.c | 11 + > .../build-attributes/build-attribute-pac.c | 11 + > .../build-attribute-standard.c | 13 + > .../build-attributes/no-build-attribute-bti.c | 12 + > .../build-attributes/no-build-attribute-gcs.c | 12 + > .../build-attributes/no-build-attribute-pac.c | 12 + > .../no-build-attribute-standard.c | 12 + > gcc/testsuite/lib/target-supports.exp | 15 ++ > 20 files changed, 647 insertions(+), 76 deletions(-) > create mode 100644 gcc/config/aarch64/aarch64-elf-metadata.cc > create mode 100644 gcc/config/aarch64/aarch64-elf-metadata.h > create mode 100644 > gcc/testsuite/gcc.target/aarch64/build-attributes/aarch64-build-attributes.exp > create mode 100644 > gcc/testsuite/gcc.target/aarch64/build-attributes/build-attribute-bti.c > create mode 100644 > gcc/testsuite/gcc.target/aarch64/build-attributes/build-attribute-gcs.c > create mode 100644 > gcc/testsuite/gcc.target/aarch64/build-attributes/build-attribute-pac.c > create mode 100644 > gcc/testsuite/gcc.target/aarch64/build-attributes/build-attribute-standard.c > create mode 100644 > gcc/testsuite/gcc.target/aarch64/build-attributes/no-build-attribute-bti.c > create mode 100644 > gcc/testsuite/gcc.target/aarch64/build-attributes/no-build-attribute-gcs.c > create mode 100644 > gcc/testsuite/gcc.target/aarch64/build-attributes/no-build-attribute-pac.c > create mode 100644 > gcc/testsuite/gcc.target/aarch64/build-attributes/no-build-attribute-standard.c