Skip to content

Commit c8eca8e

Browse files
committed
Add GCS flag to aarch64 GNU property notes
1 parent e2219a1 commit c8eca8e

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Python/asm_trampoline_aarch64.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,14 @@
3232
#define GNU_PROPERTY_AARCH64_POINTER_AUTH 0
3333
#endif
3434

35-
/* Add the BTI and PAC support to GNU Notes section */
36-
#if GNU_PROPERTY_AARCH64_BTI != 0 || GNU_PROPERTY_AARCH64_POINTER_AUTH != 0
35+
#if defined(__ARM_FEATURE_GCS_DEFAULT) && __ARM_FEATURE_GCS_DEFAULT == 1
36+
#define GNU_PROPERTY_AARCH64_GCS 4 /* bit 2 GNU Notes is for GCS support */
37+
#else
38+
#define GNU_PROPERTY_AARCH64_GCS 0
39+
#endif
40+
41+
/* Add the BTI, PAC and GCS support to GNU Notes section */
42+
#if GNU_PROPERTY_AARCH64_BTI != 0 || GNU_PROPERTY_AARCH64_POINTER_AUTH != 0 || GNU_PROPERTY_AARCH64_GCS != 0
3743
.pushsection .note.gnu.property, "a"; /* Start a new allocatable section */
3844
.balign 8; /* align it on a byte boundry */
3945
.long 4; /* size of "GNU\0" */
@@ -42,7 +48,7 @@
4248
.asciz "GNU";
4349
.long 0xc0000000; /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */
4450
.long 4; /* Four bytes of data */
45-
.long (GNU_PROPERTY_AARCH64_BTI|GNU_PROPERTY_AARCH64_POINTER_AUTH); /* BTI or PAC is enabled */
51+
.long (GNU_PROPERTY_AARCH64_BTI|GNU_PROPERTY_AARCH64_POINTER_AUTH|GNU_PROPERTY_AARCH64_GCS); /* BTI, PAC or GCS is enabled */
4652
.long 0; /* padding for 8 byte alignment */
4753
.popsection; /* end the section */
4854
#endif

0 commit comments

Comments
 (0)