00db10
commit e39adf43c7d1979884dd304ed1250baf1f78fadc
00db10
Author: Andreas Schwab <schwab@suse.de>
00db10
Date:   Mon May 20 10:19:31 2013 +0200
00db10
00db10
    AArch64: Don't clobber argument for tail call to __sigjmp_save in sigsetjmp
00db10
00db10
diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S
00db10
index cff81c7..10e0709 100644
00db10
--- glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S
00db10
+++ glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S
00db10
@@ -44,8 +44,14 @@ ENTRY (__sigsetjmp)
00db10
 	stp	d10, d11, [x0, #JB_D10<<3]
00db10
 	stp	d12, d13, [x0, #JB_D12<<3]
00db10
 	stp	d14, d15, [x0, #JB_D14<<3]
00db10
-	mov	x1,  sp
00db10
-	str	x1,  [x0, #JB_SP<<3]
00db10
+	mov	x2,  sp
00db10
+	str	x2,  [x0, #JB_SP<<3]
00db10
+#if defined NOT_IN_libc && defined IS_IN_rtld
00db10
+	/* In ld.so we never save the signal mask */
00db10
+	mov	w0, #0
00db10
+	RET
00db10
+#else
00db10
 	b	C_SYMBOL_NAME(__sigjmp_save)
00db10
+#endif
00db10
 END (__sigsetjmp)
00db10
 hidden_def (__sigsetjmp)
00db10
diff --git glibc-2.17-c758a686/setjmp/Makefile glibc-2.17-c758a686/setjmp/Makefile
00db10
index 6124333..913359c 100644
00db10
--- glibc-2.17-c758a686/setjmp/Makefile
00db10
+++ glibc-2.17-c758a686/setjmp/Makefile
00db10
@@ -25,7 +25,8 @@ headers	:= setjmp.h bits/setjmp.h bits/setjmp2.h
00db10
 routines	:= setjmp sigjmp bsd-setjmp bsd-_setjmp \
00db10
 		   longjmp __longjmp jmp-unwind
00db10
 
00db10
-tests		:= tst-setjmp jmpbug bug269-setjmp
00db10
+tests		:= tst-setjmp jmpbug bug269-setjmp \
00db10
+		   tst-sigsetjmp
00db10
 
00db10
 
00db10
 include ../Rules
00db10
diff --git glibc-2.17-c758a686/setjmp/tst-sigsetjmp.c glibc-2.17-c758a686/setjmp/tst-sigsetjmp.c
00db10
new file mode 100644
00db10
index 0000000..467c26a
00db10
--- /dev/null
00db10
+++ glibc-2.17-c758a686/setjmp/tst-sigsetjmp.c
00db10
@@ -0,0 +1,44 @@
00db10
+/* Copyright (C) 2013 Free Software Foundation, Inc.
00db10
+   This file is part of the GNU C Library.
00db10
+
00db10
+   The GNU C Library is free software; you can redistribute it and/or
00db10
+   modify it under the terms of the GNU Lesser General Public
00db10
+   License as published by the Free Software Foundation; either
00db10
+   version 2.1 of the License, or (at your option) any later version.
00db10
+
00db10
+   The GNU C Library is distributed in the hope that it will be useful,
00db10
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
+   Lesser General Public License for more details.
00db10
+
00db10
+   You should have received a copy of the GNU Lesser General Public
00db10
+   License along with the GNU C Library; if not, see
00db10
+   <http://www.gnu.org/licenses/>.  */
00db10
+
00db10
+/* Test case for BZ #15493 */
00db10
+
00db10
+#include <stdlib.h>
00db10
+#include <signal.h>
00db10
+#include <setjmp.h>
00db10
+
00db10
+static int
00db10
+do_test (void)
00db10
+{
00db10
+  sigjmp_buf sj;
00db10
+  sigset_t m;
00db10
+
00db10
+  sigemptyset (&m);
00db10
+  sigprocmask (SIG_SETMASK, &m, NULL);
00db10
+  if (sigsetjmp (sj, 0) == 0)
00db10
+    {
00db10
+      sigaddset (&m, SIGUSR1);
00db10
+      sigprocmask (SIG_SETMASK, &m, NULL);
00db10
+      siglongjmp (sj, 1);
00db10
+      return EXIT_FAILURE;
00db10
+    }
00db10
+  sigprocmask (SIG_SETMASK, NULL, &m);
00db10
+  return sigismember (&m, SIGUSR1) ? EXIT_SUCCESS : EXIT_FAILURE;
00db10
+}
00db10
+
00db10
+#define TEST_FUNCTION do_test ()
00db10
+#include "../test-skeleton.c"