From 36e8b6a28be5d4ffad966386b1e1c0d0dc6ca11a Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 2 Nov 2015 16:16:00 -0500 Subject: use explicit __cp_cancel label in cancellable syscall asm for all archs previously, only archs that needed to do stack cleanup defined a __cp_cancel label for acting on cancellation in their syscall asm, and a default definition was provided by a weak alias to __cancel, the C function. this resulted in wrong codegen for arm on gcc versions affected by pr 68178 and possibly similar issues (like pr 66609) on other archs, and also created an inconsistency where the __cp_begin and __cp_end labels were treated as const data but __cp_cancel was treated as a function. this in turn caused incorrect code generation on archs where function pointers point to function descriptors rather than code (for now, only sh/fdpic). --- src/thread/pthread_cancel.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/thread/pthread_cancel.c') diff --git a/src/thread/pthread_cancel.c b/src/thread/pthread_cancel.c index 6eaf72c4..c4631f08 100644 --- a/src/thread/pthread_cancel.c +++ b/src/thread/pthread_cancel.c @@ -7,7 +7,7 @@ #ifdef SHARED __attribute__((__visibility__("hidden"))) #endif -long __cancel(), __cp_cancel(), __syscall_cp_asm(), __syscall_cp_c(); +long __cancel(), __syscall_cp_asm(), __syscall_cp_c(); long __cancel() { @@ -18,12 +18,6 @@ long __cancel() return -ECANCELED; } -/* If __syscall_cp_asm has adjusted the stack pointer, it must provide a - * definition of __cp_cancel to undo those adjustments and call __cancel. - * Otherwise, __cancel provides a definition for __cp_cancel. */ - -weak_alias(__cancel, __cp_cancel); - long __syscall_cp_asm(volatile void *, syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t, syscall_arg_t); @@ -56,7 +50,7 @@ static void _sigaddset(sigset_t *set, int sig) #ifdef SHARED __attribute__((__visibility__("hidden"))) #endif -extern const char __cp_begin[1], __cp_end[1]; +extern const char __cp_begin[1], __cp_end[1], __cp_cancel[1]; static void cancel_handler(int sig, siginfo_t *si, void *ctx) { -- cgit v1.2.1