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/aarch64/syscall_cp.s | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/thread/aarch64') diff --git a/src/thread/aarch64/syscall_cp.s b/src/thread/aarch64/syscall_cp.s index 30e677ce..41db68af 100644 --- a/src/thread/aarch64/syscall_cp.s +++ b/src/thread/aarch64/syscall_cp.s @@ -17,7 +17,7 @@ __syscall_cp_asm: __cp_begin: ldr w0,[x0] - cbnz w0,1f + cbnz w0,__cp_cancel mov x8,x1 mov x0,x2 mov x1,x3 @@ -28,6 +28,5 @@ __cp_begin: svc 0 __cp_end: ret - - // cbnz might not be able to jump far enough -1: b __cancel +__cp_cancel: + b __cancel -- cgit v1.2.1