This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Saving errno around signal handlers
- From: Richard Henderson <rth at twiddle dot net>
- To: Florian Weimer <fweimer at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 28 Feb 2014 09:06:38 -0800
- Subject: Re: Saving errno around signal handlers
- Authentication-results: sourceware.org; auth=none
- References: <531077D9 dot 2000308 at redhat dot com> <5310BE05 dot 7090606 at twiddle dot net> <5310C04E dot 9090009 at redhat dot com>
On 02/28/2014 08:58 AM, Florian Weimer wrote:
> On 02/28/2014 05:49 PM, Richard Henderson wrote:
>> On 02/28/2014 03:49 AM, Florian Weimer wrote:
>>>
>>> In all cases (kernel and glibc implementation), we can use a tail call to make
>>> sure that the stack layout looks like it is at present (at least on
>>> architectures with an available callee-saved register), and we would not have
>>> to adjust GDB and other tools.
>>
>> How's that? A tail call would not be able to "restore" anything afterward.
>
> We already have the restorer that calls sigreturn, and could add
>
> movq errno@gottpoff(%rip), %rdi
> movl %r12d, %fs:(%rdi)
>
> right before that.
>
Doesn't that sigreturn trampoline live in the kernel vdso? At least for the
most popular of platforms. Or is this proposal limited to forcing the use of
some form of SA_RESTORER by glibc?
I'll note that this *may* affect other tools, that have previously looked
through trampolines via code inspection.
But so long as this new trampoline has proper unwind info associated, I
personally don't care. These older tools really ought to get updated.
r~