From d183d93e47ad16bc9983107a419121b02e0da51e Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 17 May 2017 11:07:36 +0200 Subject: x86: fix segfaults on SMP machine As reported by Bering-uClibc project uClibc-ng for x86 generates a segfault on SMP machines when trying to run ntpd. A small test case is here: https://gist.github.com/ddrown Use a similar nop instruction as for x86_64 in the code. Signed-off-by: KP.Kirchdoerfer --- libc/sysdeps/linux/i386/sigaction.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libc/sysdeps/linux/i386/sigaction.c b/libc/sysdeps/linux/i386/sigaction.c index 77da69d5e..cf6daa787 100644 --- a/libc/sysdeps/linux/i386/sigaction.c +++ b/libc/sysdeps/linux/i386/sigaction.c @@ -115,6 +115,7 @@ libc_hidden_weak(sigaction) /* The return code for realtime-signals. */ # define RESTORE2(name, syscall) \ __asm__ ( \ + "nop\n" \ ".text\n" \ "__" #name ":\n" \ " movl $" #syscall ", %eax\n" \ @@ -128,6 +129,7 @@ RESTORE(restore_rt, __NR_rt_sigreturn) # undef RESTORE2 # define RESTORE2(name, syscall) \ __asm__ ( \ + "nop\n" \ ".text\n" \ "__" #name ":\n" \ " popl %eax\n" \ -- cgit v1.2.3