From 234c58467c3709bafdd3ffa6ac73655e1dfd9ddb Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 12 Sep 2015 02:55:28 +0000 Subject: 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. --- arch/sh/src/__shcall.c | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 arch/sh/src/__shcall.c (limited to 'arch/sh/src') 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); +} -- cgit v1.2.3-70-g09d2