aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Chagin <dchagin@FreeBSD.org>2023-07-07 16:55:08 +0000
committerDmitry Chagin <dchagin@FreeBSD.org>2023-07-07 16:55:08 +0000
commit5645dfb41ae0d5ca0acdee8a2a6646787b33e03f (patch)
tree981a20e4a6ce449380cf398e416f23d66042b37f
parent43e29d03f416d7dda52112a29600a7c82ee1a91e (diff)
downloadsrc-5645dfb41ae0d5ca0acdee8a2a6646787b33e03f.tar.gz
src-5645dfb41ae0d5ca0acdee8a2a6646787b33e03f.zip
rtld: Sligtly optimizing .rtld_start on aarch64
Use the LDP (load pair registers) instruction to load entry point arguments from the stack. Reviewed by: Differential Revision: https://reviews.freebsd.org/D40843
-rw-r--r--libexec/rtld-elf/aarch64/rtld_start.S5
1 files changed, 1 insertions, 4 deletions
diff --git a/libexec/rtld-elf/aarch64/rtld_start.S b/libexec/rtld-elf/aarch64/rtld_start.S
index 196559d9d2bc..4f0bef0233b0 100644
--- a/libexec/rtld-elf/aarch64/rtld_start.S
+++ b/libexec/rtld-elf/aarch64/rtld_start.S
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
ENTRY(.rtld_start)
mov x19, x0 /* Put ps_strings in a callee-saved register */
- mov x20, sp /* And the stack pointer */
sub sp, sp, #16 /* Make room for obj_main & exit proc */
@@ -40,11 +39,9 @@ ENTRY(.rtld_start)
add x2, x1, #8 /* obj_main */
bl _rtld /* Call the loader */
mov x8, x0 /* Backup the entry point */
+ ldp x2, x1, [sp], #16 /* Load cleanup, obj_main */
- ldr x2, [sp] /* Load cleanup */
- ldr x1, [sp, #8] /* Load obj_main */
mov x0, x19 /* Restore ps_strings */
- mov sp, x20 /* Restore the stack pointer */
br x8 /* Jump to the entry point */
END(.rtld_start)