aboutsummaryrefslogtreecommitdiffhomepage
path: root/targets
diff options
context:
space:
mode:
authorLucas Teske <[email protected]>2020-09-16 02:07:01 -0300
committerRon Evans <[email protected]>2020-09-17 07:46:29 +0200
commit622de5385419d7765aec7a59d4be969a33805b4a (patch)
treeaaf19aa4aade7479e44cde8600ae527551e3dbb1 /targets
parent6cd9e3c34837e2ec853b26458fe4a340c5bee5f2 (diff)
downloadtinygo-622de5385419d7765aec7a59d4be969a33805b4a.tar.gz
tinygo-622de5385419d7765aec7a59d4be969a33805b4a.zip
nintendoswitch: simplified assembly code
Diffstat (limited to 'targets')
-rw-r--r--targets/nintendoswitch.s23
1 files changed, 3 insertions, 20 deletions
diff --git a/targets/nintendoswitch.s b/targets/nintendoswitch.s
index 139c2266e..38e0b39e6 100644
--- a/targets/nintendoswitch.s
+++ b/targets/nintendoswitch.s
@@ -51,9 +51,8 @@ start:
mov x5, x0
mov x4, x1
- // Save lr, context pointer, main thread handler
- adrp x0, _aslr_base
- str x6, [x0, #:lo12:_aslr_base]
+ // Save ASLR Base to use later
+ mov x0, x6
// clear .bss
adrp x5, __bss_start
@@ -70,26 +69,10 @@ bssloop:
run:
// process .dynamic section
- adrp x0, _aslr_base
- ldr x0, [x0, #:lo12:_aslr_base]
+ // ASLR base on x0
adrp x1, _DYNAMIC
add x1, x1, #:lo12:_DYNAMIC
bl __dynamic_loader
- // set LR to svcExitProcess if it's null
- adrp x3, exit
- add x3, x3, #:lo12:exit
- cmp x30, xzr
- csel x30, x3, x30, eq
-
// call entrypoint
- mov x3, sp
- sub sp, sp, 0x10
- stp x29, x30, [sp]
b main
-
-.section .data.horizon
-.align 8
-.global _aslr_base // Placeholder for ASLR Base Address
-_aslr_base:
- .dword 0