aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorSrinath Parvathaneni <srinath.parvathaneni@arm.com>2024-10-28 18:13:08 +0000
committerMatthieu Longo <matthieu.longo@arm.com>2024-12-02 15:18:41 +0000
commitb75ce33f0cd3a4720c252969bfffdac4f3f998a7 (patch)
treec6b6bc86e2d9ec80faf89d4681dba660080a4830 /binutils/readelf.c
parentf1cd84f4c55f3b361cb219f625a397ee039ad0d2 (diff)
downloadbinutils-b75ce33f0cd3a4720c252969bfffdac4f3f998a7.zip
binutils-b75ce33f0cd3a4720c252969bfffdac4f3f998a7.tar.gz
binutils-b75ce33f0cd3a4720c252969bfffdac4f3f998a7.tar.bz2
aarch64: GCS feature check in GNU note properties for input objects
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 GCS feature in 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". When '-z gcs' option is omitted from the command line, it defaults to "implicit" and relies on the GCS feature marking in GNU properties. 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=warning". When this option is omitted from the command line, it defaults to "warning". 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>
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 73163e0..64e461d 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -21239,6 +21239,10 @@ decode_aarch64_feature_1_and (unsigned int bitmask)
printf ("PAC");
break;
+ case GNU_PROPERTY_AARCH64_FEATURE_1_GCS:
+ printf ("GCS");
+ break;
+
default:
printf (_("<unknown: %x>"), bit);
break;