git: 37c1ef5ac0a2 - main - Move the arm64 sigcode to .rodata

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Wed, 17 May 2023 11:31:16 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=37c1ef5ac0a2867a59cfbdd73f1970389a7fc8e8

commit 37c1ef5ac0a2867a59cfbdd73f1970389a7fc8e8
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2023-05-17 11:00:12 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2023-05-17 11:28:45 +0000

    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
---
 sys/arm64/arm64/locore.S   | 8 +++++---
 sys/arm64/arm64/sigtramp.S | 7 +++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S
index e17f897baeab..e26003b6c926 100644
--- a/sys/arm64/arm64/locore.S
+++ b/sys/arm64/arm64/locore.S
@@ -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
diff --git a/sys/arm64/arm64/sigtramp.S b/sys/arm64/arm64/sigtramp.S
index a9ad10da766c..f1936e695f33 100644
--- a/sys/arm64/arm64/sigtramp.S
+++ b/sys/arm64/arm64/sigtramp.S
@@ -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