Pārlūkot izejas kodu

ARC/signal: shield sa_restorer from compiler toggle side-effects

when building uClibc with -O0 (DODEBUG build) the default sigrestorer
had some extra glue code generated for stack manipulation which was
messing up resume from signal path.

So annotate the function with -Os so that gcc would only generate the
bare min 2 instruction TRAP sequence

Reported-and-Debugged-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Vineet Gupta 9 gadi atpakaļ
vecāks
revīzija
d3c60fc490
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      libc/sysdeps/linux/arc/sigaction.c

+ 2 - 1
libc/sysdeps/linux/arc/sigaction.c

@@ -13,7 +13,8 @@
 /*
  * Default sigretrun stub if user doesn't specify SA_RESTORER
  */
-static void __default_rt_sa_restorer(void)
+static void attribute_optimize("Os") __attribute_noinline__
+__default_rt_sa_restorer(void)
 {
 	INTERNAL_SYSCALL_NCS(__NR_rt_sigreturn, , 0);
 }