Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F135583234
D42227.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D42227.diff
View Options
diff --git a/lib/csu/aarch64/crt1_s.S b/lib/csu/aarch64/crt1_s.S
--- a/lib/csu/aarch64/crt1_s.S
+++ b/lib/csu/aarch64/crt1_s.S
@@ -30,6 +30,8 @@
*/
#include <machine/asm.h>
+#include <sys/elf_common.h>
+
/*
* The program entry point
* void _start(char **ap, void (*cleanup)(void)) __dead2
@@ -62,3 +64,5 @@
END(_start)
.section .note.GNU-stack,"",@progbits
+
+GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL)
diff --git a/lib/csu/aarch64/crti.S b/lib/csu/aarch64/crti.S
--- a/lib/csu/aarch64/crti.S
+++ b/lib/csu/aarch64/crti.S
@@ -28,11 +28,14 @@
*/
#include <machine/asm.h>
+#include <sys/elf_common.h>
+
.section .init,"ax",@progbits
.align 4
.globl _init
.type _init,@function
_init:
+ PAC_LR_SIGN
stp x29, x30, [sp, #-16]!
mov x29, sp
@@ -41,6 +44,8 @@
.globl _fini
.type _fini,@function
_fini:
+ PAC_LR_SIGN
stp x29, x30, [sp, #-16]!
mov x29, sp
+GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL)
diff --git a/lib/csu/aarch64/crtn.S b/lib/csu/aarch64/crtn.S
--- a/lib/csu/aarch64/crtn.S
+++ b/lib/csu/aarch64/crtn.S
@@ -28,13 +28,19 @@
*/
#include <machine/asm.h>
+#include <sys/elf_common.h>
+
.section .init,"ax",@progbits
ldp x29, x30, [sp], #16
+ PAC_LR_AUTH
ret
.section .fini,"ax",@progbits
ldp x29, x30, [sp], #16
+ PAC_LR_AUTH
ret
.section .note.GNU-stack,"",%progbits
+
+GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL)
diff --git a/lib/csu/common/crtbrand.S b/lib/csu/common/crtbrand.S
--- a/lib/csu/common/crtbrand.S
+++ b/lib/csu/common/crtbrand.S
@@ -47,3 +47,8 @@
4:
.section .note.GNU-stack,"",%progbits
+
+#ifdef __aarch64__
+/* This is needed in all objects for BTI to be used in the linked elf file */
+GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL)
+#endif
diff --git a/lib/csu/common/feature_note.S b/lib/csu/common/feature_note.S
--- a/lib/csu/common/feature_note.S
+++ b/lib/csu/common/feature_note.S
@@ -40,3 +40,8 @@
4:
.section .note.GNU-stack,"",%progbits
+
+#ifdef __aarch64__
+/* This is needed in all objects for BTI to be used in the linked elf file */
+GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL)
+#endif
diff --git a/lib/csu/common/ignore_init_note.S b/lib/csu/common/ignore_init_note.S
--- a/lib/csu/common/ignore_init_note.S
+++ b/lib/csu/common/ignore_init_note.S
@@ -41,3 +41,8 @@
4:
.section .note.GNU-stack,"",%progbits
+
+#ifdef __aarch64__
+/* This is needed in all objects for BTI to be used in the linked elf file */
+GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL)
+#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 12, 1:17 AM (1 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25187471
Default Alt Text
D42227.diff (2 KB)
Attached To
Mode
D42227: csu: Teach libc about PAC and BTI
Attached
Detach File
Event Timeline
Log In to Comment