The primary focus of this patch series is to add support for build attributes 
in the context of GCS (Guarded Control Stack, an Armv9.4-a extension) to the 
AArch64 backend.
It addresses comments from a previous review [1], and proposes a different 
approach compared to the previous implementation of the build attributes.

The series is for now at the RFC stage, and is composed of the following 4 
patches:
1. Patch adding assembly debug comments (-dA) to the existing GNU properties, 
to improve testing and check the correctness of values.
2. The minimal patch adding support for build attributes in the context of GCS.
3. A refactoring of (2) to make things less error-prone and more modular, add 
support for asciz attributes and more debug information.
4. A refactoring of (1) relying partly on (3).
The targeted final state of this series would consist in squashing (2) + (3), 
and (1) + (4).

**Special note regarding (2):** If Gas has support for build attributes, both 
build attributes and GNU properties will be emitted. This behavior is still 
open for discussion. Please, let me know your thoughts regarding this behavior.

Diff with previous revision [1]:
- update the description of (2)
- address the comments related to the tests in (2)
- add new commits (1), (3) and (4)

This patch series needs to be applied on top of the patch series for GCS [2].

Bootstrapped on aarch64-none-linux-gnu, and no regression found.

[1]: https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662825.html
[2]: https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/vendors/ARM/heads/gcs

Regards,
Matthieu


Matthieu Longo (3):
  aarch64: add debug comments to feature properties in .note.gnu.property
  aarch64: improve assembly debug comments for build attributes
  aarch64: encapsulate note.gnu.property emission into a class

Srinath Parvathaneni (1):
  aarch64: add minimal support for GCS build attributes

 gcc/config.gcc                                |   2 +-
 gcc/config.in                                 |   6 +
 gcc/config/aarch64/aarch64-dwarf-metadata.cc  | 120 ++++++++
 gcc/config/aarch64/aarch64-dwarf-metadata.h   | 266 ++++++++++++++++++
 gcc/config/aarch64/aarch64.cc                 |  68 ++---
 gcc/config/aarch64/t-aarch64                  |   7 +
 gcc/configure                                 |  38 +++
 gcc/configure.ac                              |  10 +
 gcc/testsuite/gcc.target/aarch64/bti-1.c      |   5 +-
 .../build-attributes/build-attribute-gcs.c    |  12 +
 .../build-attribute-standard.c                |  12 +
 .../build-attributes/build-attributes.exp     |  46 +++
 .../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 +
 16 files changed, 594 insertions(+), 46 deletions(-)
 create mode 100644 gcc/config/aarch64/aarch64-dwarf-metadata.cc
 create mode 100644 gcc/config/aarch64/aarch64-dwarf-metadata.h
 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-standard.c
 create mode 100644 
gcc/testsuite/gcc.target/aarch64/build-attributes/build-attributes.exp
 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

-- 
2.46.1

Reply via email to