This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Saving errno around signal handlers


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.

--
Florian Weimer / Red Hat Product Security Team


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]