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.
This commit is contained in:
Rich Felker
2015-09-12 02:55:28 +00:00
parent ad5d8a2bf3
commit 234c58467c
2 changed files with 14 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
__attribute__((__visibility__("hidden")))
int __shcall(void *arg, int (*func)(void *))
{
return func(arg);
}