Linux x86 unwinder: Handle __NR_sigreturn for __kernel_sigreturn support
Florian Weimer
fweimer@redhat.com
Fri Dec 14 18:20:00 GMT 2018
I believe this may address recent unwinder failures in Fedora if the
vDSO unwinder does not contain unwinding data:
<https://bugzilla.redhat.com/show_bug.cgi?id=1659295>
The question is: Do we want to move in that direction? Or should we
make clear that the userspace ABI *requires* unwinding information?
Thanks,
Florian
2018-12-14 Florian Weimer <fweimer@redhat.com>
* config/i386/linux-unwind.h (x86_frob_update_context): Also check
for __NR_sigreturn.
diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
index ea838e4e47b..502a87a2cb0 100644
--- a/libgcc/config/i386/linux-unwind.h
+++ b/libgcc/config/i386/linux-unwind.h
@@ -190,9 +190,10 @@ x86_frob_update_context (struct _Unwind_Context *context,
{
unsigned char *pc = context->ra;
- /* movl $__NR_rt_sigreturn,%eax ; {int $0x80 | syscall} */
+ /* movl $__NR_{rt_|}sigreturn,%eax ; {int $0x80 | syscall} */
if (*(unsigned char *)(pc+0) == 0xb8
- && *(unsigned int *)(pc+1) == 173
+ && (*(unsigned int *)(pc+1) == 119
+ || *(unsigned int *)(pc+1) == 173)
&& (*(unsigned short *)(pc+5) == 0x80cd
|| *(unsigned short *)(pc+5) == 0x050f))
_Unwind_SetSignalFrame (context, 1);
More information about the Gcc-patches
mailing list