summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/xtensa/crtn.S
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2024-06-01 03:39:03 -0700
committerWaldemar Brodkorb <wbx@openadk.org>2024-06-04 16:40:42 +0200
commit138274e92a01be8a98392489b1a2f497ab11c201 (patch)
treef0be841a1e915e86d4215326a13654f8034632a4 /libc/sysdeps/linux/xtensa/crtn.S
parent8bb33a2e1f2baec2078581d77e181f1ead5f51aa (diff)
xtensa: add FDPIC support
This change implements Xtensa FDPIC ABI as specified in the first version of the following document: https://github.com/jcmvbkbc/xtensa-abi/blob/master/fdpic-xtensa.txt Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/xtensa/crtn.S')
-rw-r--r--libc/sysdeps/linux/xtensa/crtn.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/xtensa/crtn.S b/libc/sysdeps/linux/xtensa/crtn.S
index a3598da1a..6f797e8bd 100644
--- a/libc/sysdeps/linux/xtensa/crtn.S
+++ b/libc/sysdeps/linux/xtensa/crtn.S
@@ -4,6 +4,9 @@
#if defined(__XTENSA_WINDOWED_ABI__)
retw
#elif defined(__XTENSA_CALL0_ABI__)
+#ifdef __FDPIC__
+ l32i a12, sp, 4
+#endif
l32i a0, sp, 0
addi sp, sp, 16
ret
@@ -15,6 +18,9 @@
#if defined(__XTENSA_WINDOWED_ABI__)
retw
#elif defined(__XTENSA_CALL0_ABI__)
+#ifdef __FDPIC__
+ l32i a12, sp, 4
+#endif
l32i a0, sp, 0
addi sp, sp, 16
ret