about summary refs log tree commit diff
path: root/arch
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-09-12 02:55:28 +0000
committerRich Felker <dalias@aerifal.cx>2015-09-12 02:55:28 +0000
commit234c58467c3709bafdd3ffa6ac73655e1dfd9ddb (patch)
treed1357427a86e6dc14fe09573745a506c36b146c0 /arch
parentad5d8a2bf3526bce4317055612709ac076b5c4c3 (diff)
downloadmusl-234c58467c3709bafdd3ffa6ac73655e1dfd9ddb.tar.gz
musl-234c58467c3709bafdd3ffa6ac73655e1dfd9ddb.tar.xz
musl-234c58467c3709bafdd3ffa6ac73655e1dfd9ddb.zip
make sh clone asm fdpic-compatible
clone calls back to a function pointer provided by the caller, which
will actually be a pointer to a function descriptor on fdpic. the
obvious solution is to have a separate version of clone for fdpic, but
I have taken a simpler approach to go around the problem. instead of
calling the pointed-to function from asm, a direct call is made to an
internal C function which then calls the pointed-to function. this
lets the C compiler generate the appropriate calling convention for an
indirect call with no need for ABI-specific assembly.
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/src/__shcall.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/sh/src/__shcall.c b/arch/sh/src/__shcall.c
new file mode 100644
index 00000000..dfe80a7f
--- /dev/null
+++ b/arch/sh/src/__shcall.c
@@ -0,0 +1,5 @@
+__attribute__((__visibility__("hidden")))
+int __shcall(void *arg, int (*func)(void *))
+{
+	return func(arg);
+}