From 23d857c834212c20e370be568f56ed7bce6c1e18 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 4 Jul 2019 13:22:42 +0200 Subject: [PATCH] signal: Add comment on why we don't use the restorer. * lib/linux/signal.c: Add comment on why we don't use the restorer. --- lib/linux/signal.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/linux/signal.c b/lib/linux/signal.c index 676a0a47..fe18d048 100644 --- a/lib/linux/signal.c +++ b/lib/linux/signal.c @@ -44,6 +44,16 @@ signal (int signum, sighandler_t action) unsigned short itembitcount; setup_action.sa_handler = action; + /* The sa_restorer is not used. Reason: + * The kernel uses its own restorer anyway by pretending we gave one on + our side (no, really). + glibc still has a custom restorer because they want to be able to + backtrace. gdb has a second part that detects a specific instruction + sequence and then fixes up the backtrace. Since we don't use that + specific instruction sequence and also the non-siginfo restorer + is complicated (pops foreign item off the stack--so needs inline + assembly) and we don't support great debuggability in other places, + I've decided to take the easy way out for now. */ /*setup_action.sa_restorer = _restorer_for_siginfo;*/ bitindex = signum - 1; itembitcount = 8 * sizeof(setup_action.sa_mask.items[0]);