summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/xtensa/clone.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/clone.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/clone.S')
-rw-r--r--libc/sysdeps/linux/xtensa/clone.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/xtensa/clone.S b/libc/sysdeps/linux/xtensa/clone.S
index ebfdcc1f6..a11044cd0 100644
--- a/libc/sysdeps/linux/xtensa/clone.S
+++ b/libc/sysdeps/linux/xtensa/clone.S
@@ -81,11 +81,17 @@ ENTRY (__clone)
callx4 a2
#elif defined(__XTENSA_CALL0_ABI__)
mov a2, a9 /* load up the 'arg' parameter */
+#ifdef __FDPIC__
+ mov a12, a11
+ l32i a11, a7, 4
+ l32i a7, a7, 0
+#endif
callx0 a7 /* call the user's function */
/* Call _exit. Note that any return parameter from the user's
function in a2 is seen as inputs to _exit. */
movi a0, JUMPTARGET(_exit)
+ FDPIC_LOAD_JUMPTARGET(a0, a12, a0)
callx0 a0
#else
#error Unsupported Xtensa ABI