]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: add debug comments to feature properties in .note.gnu.property
authorMatthieu Longo <matthieu.longo@arm.com>
Mon, 23 Sep 2024 13:38:57 +0000 (14:38 +0100)
committerMatthieu Longo <matthieu.longo@arm.com>
Mon, 16 Jun 2025 09:13:45 +0000 (10:13 +0100)
commit6eb0dc067dad1fe745e83d4e113c1b2ea0ffed8c
treecd987c4cddc1484875a02b87b4f71d3245888168
parent2ef043c5a05d9914e3c3dbff6f2c521eb665d971
aarch64: add debug comments to feature properties in .note.gnu.property

GNU properties are emitted to provide some information about the features
used in the generated code like BTI, GCS, or PAC. However, no debug
comment are emitted in the generated assembly even if -dA is provided.
It makes understanding the information stored in the .note.gnu.property
section more difficult than needed.

This patch adds assembly comments (if -dA is provided) next to the GNU
properties. For instance, if BTI and PAC are enabled, it will emit:
  .word  0x3  // GNU_PROPERTY_AARCH64_FEATURE_1_AND (BTI, PAC)

gcc/ChangeLog:

* config/aarch64/aarch64.cc
(aarch64_file_end_indicate_exec_stack): Emit assembly comments.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/bti-1.c: Emit assembly comments, and update
test assertion.
gcc/config/aarch64/aarch64.cc
gcc/testsuite/gcc.target/aarch64/bti-1.c