Move the arm64 sigcode to .rodata

The kernel doesn't execute this code, it's only ever copied to
userspace. Move it to .rodata as we don't need to modify it.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39399
This commit is contained in:
Andrew Turner
2023-05-17 12:00:12 +01:00
parent 71fde8e507
commit 37c1ef5ac0
2 changed files with 10 additions and 5 deletions
+5 -3
View File
@@ -918,8 +918,10 @@ pagetable_end:
el2_pagetable:
.space PAGE_SIZE
.text
EENTRY(aarch32_sigcode)
.section .rodata, "a", %progbits
.globl aarch32_sigcode
.align 2
aarch32_sigcode:
.word 0xe1a0000d // mov r0, sp
.word 0xe2800040 // add r0, r0, #SIGF_UC
.word 0xe59f700c // ldr r7, [pc, #12]
@@ -927,10 +929,10 @@ EENTRY(aarch32_sigcode)
.word 0xe59f7008 // ldr r7, [pc, #8]
.word 0xef000000 // swi #0
.word 0xeafffffa // b . - 16
EEND(aarch32_sigcode)
.word SYS_sigreturn
.word SYS_exit
.align 3
.size aarch32_sigcode, . - aarch32_sigcode
aarch32_esigcode:
.data
.global sz_aarch32_sigcode
+5 -2
View File
@@ -30,7 +30,10 @@
#include <sys/syscall.h>
#include <machine/asm.h>
ENTRY(sigcode)
.section .rodata, "a", %progbits
.globl sigcode
.align 2
sigcode:
blr x8
mov x0, sp
add x0, x0, #SF_UC
@@ -44,9 +47,9 @@ ENTRY(sigcode)
svc 0
b 1b
END(sigcode)
/* This may be copied to the stack, keep it 16-byte aligned */
.align 3
.size sigcode, . - sigcode
esigcode:
.data