diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2020-04-29 11:49:20 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2020-07-08 15:02:38 +0100 |
commit | 1be3d6eb823d8b952fa54b7bbc90cbecb8981380 (patch) | |
tree | 4791e16bdb376f2a47f1e307d0316f7687cdd8e7 /sysdeps/aarch64/sysdep.h | |
parent | 9e1751e6d693b73b95db2f6d8438dd80f1aeffe0 (diff) | |
download | glibc-1be3d6eb823d8b952fa54b7bbc90cbecb8981380.tar.gz glibc-1be3d6eb823d8b952fa54b7bbc90cbecb8981380.tar.xz glibc-1be3d6eb823d8b952fa54b7bbc90cbecb8981380.zip |
aarch64: Add pac-ret support to assembly files
Use return address signing in assembly files for functions that save LR when pac-ret is enabled in the compiler. The GNU property note for PAC-RET is not meaningful to the dynamic linker so it is not strictly required, but it may be used to track the security property of binaries. (The PAC-RET property is only set if BTI is set too because BTI implies working GNU property support.) Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/aarch64/sysdep.h')
-rw-r--r-- | sysdeps/aarch64/sysdep.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index 0eeb0bb2f1..cd88023163 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -45,6 +45,10 @@ #define BTI_C hint 34 #define BTI_J hint 36 +/* Return address signing support (pac-ret). */ +#define PACIASP hint 25 +#define AUTIASP hint 29 + /* GNU_PROPERTY_AARCH64_* macros from elf.h for use in asm code. */ #define FEATURE_1_AND 0xc0000000 #define FEATURE_1_BTI 1 @@ -66,7 +70,9 @@ /* Add GNU property note with the supported features to all asm code where sysdep.h is included. */ -#if HAVE_AARCH64_BTI +#if HAVE_AARCH64_BTI && HAVE_AARCH64_PAC_RET +GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC) +#elif HAVE_AARCH64_BTI GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI) #endif |