summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2018-07-04 17:55:27 +0200
committerWaldemar Brodkorb <wbrodkorb@conet.de>2018-08-10 16:02:45 +0200
commitbb982429e7cb108510b89ef3b4448c5a59f5df7a (patch)
tree20a9d6fad763b80a87ddecc5ceb2a19a3e6e209b /libc
parentb79c7b582278ab6a6c8112aeff79b85089aab32d (diff)
arm/clone.S: Fix threading support
Change clone.S so that in FDPIC case we take into account the fact that we are given a function descriptor. * libc/sysdeps/linux/arm/clone.S (__clone): Support __FDPIC__. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/arm/clone.S12
1 files changed, 12 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
index 8ca50fce4..eacf3dba6 100644
--- a/libc/sysdeps/linux/arm/clone.S
+++ b/libc/sysdeps/linux/arm/clone.S
@@ -130,8 +130,20 @@ PSEUDO_END (__clone)
.cantunwind
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
+#if defined(__FDPIC__)
+ ldr r12, [sp]
+ mov r4, r9
+ ldr r9, [r12, #4]
+ mov lr, pc
+ ldr pc, [r12]
+#else
mov lr, pc
ldr pc, [sp]
+#endif
+
+#if defined(__FDPIC__)
+ mov r9, r4
+#endif
@ and we are done, passing the return value through r0
b HIDDEN_JUMPTARGET(_exit)