|
|
ce426f |
#
|
|
|
ce426f |
# Upstream power patch to increase MINSIGSTKSZ and SIGSTKSZ to
|
|
|
ce426f |
# account for the kernel signal frame size increase.
|
|
|
ce426f |
#
|
|
|
ce426f |
# commit f7c399cff5bd04ee9dc117fb6b0f39597dc047c6
|
|
|
ce426f |
# Author: Alan Modra <amodra@gmail.com>
|
|
|
ce426f |
# Date: Sat Aug 17 18:37:18 2013 +0930
|
|
|
ce426f |
#
|
|
|
ce426f |
# PowerPC SIGSTKSZ
|
|
|
ce426f |
# http://sourceware.org/ml/libc-alpha/2013-08/msg00093.html
|
|
|
ce426f |
#
|
|
|
ce426f |
# This copies the sparc version of sigstack.h, which gives powerpc
|
|
|
ce426f |
# #define MINSIGSTKSZ 4096
|
|
|
ce426f |
# #define SIGSTKSZ 16384
|
|
|
ce426f |
#
|
|
|
ce426f |
# Before the VSX changes, struct rt_sigframe size was 1920 plus 128 for
|
|
|
ce426f |
# __SIGNAL_FRAMESIZE giving ppc64 exactly the default MINSIGSTKSZ of
|
|
|
ce426f |
# 2048.
|
|
|
ce426f |
#
|
|
|
ce426f |
# After VSX, ucontext increased by 256 bytes. Oops, we're over
|
|
|
ce426f |
# MINSIGSTKSZ, so powerpc has been using the wrong value for quite a
|
|
|
ce426f |
# while. Add another ucontext for TM and rt_sigframe is now at 3872,
|
|
|
ce426f |
# giving actual MINSIGSTKSZ of 4000.
|
|
|
ce426f |
#
|
|
|
ce426f |
# The glibc testcase that I was looking at was tst-cancel21, which
|
|
|
ce426f |
# allocates 2*SIGSTKSZ (not because the test is trying to be
|
|
|
ce426f |
# conservative, but because the test actually has nested signal stack
|
|
|
ce426f |
# frames). We blew the allocation by 48 bytes when using current
|
|
|
ce426f |
# mainline gcc to compile glibc (le ppc64).
|
|
|
ce426f |
#
|
|
|
ce426f |
# The required stack depth in _dl_lookup_symbol_x from the top of the
|
|
|
ce426f |
# next signal frame was 10944 bytes. I guess you'd want to add 288 to
|
|
|
ce426f |
# that, implying an actual SIGSTKSZ of 11232.
|
|
|
ce426f |
#
|
|
|
ce426f |
# * sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h: New file.
|
|
|
ce426f |
#
|
|
|
ce426f |
diff --git glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
|
|
|
ce426f |
new file mode 100644
|
|
|
ce426f |
index 0000000..33be9e8
|
|
|
ce426f |
--- /dev/null
|
|
|
ce426f |
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
|
|
|
ce426f |
@@ -0,0 +1,54 @@
|
|
|
ce426f |
+/* sigstack, sigaltstack definitions.
|
|
|
ce426f |
+ Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
|
|
ce426f |
+ This file is part of the GNU C Library.
|
|
|
ce426f |
+
|
|
|
ce426f |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
ce426f |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
ce426f |
+ License as published by the Free Software Foundation; either
|
|
|
ce426f |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
ce426f |
+
|
|
|
ce426f |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
ce426f |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
ce426f |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
ce426f |
+ Lesser General Public License for more details.
|
|
|
ce426f |
+
|
|
|
ce426f |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
ce426f |
+ License along with the GNU C Library; if not, see
|
|
|
ce426f |
+ <http://www.gnu.org/licenses/>. */
|
|
|
ce426f |
+
|
|
|
ce426f |
+#ifndef _SIGNAL_H
|
|
|
ce426f |
+# error "Never include this file directly. Use <signal.h> instead"
|
|
|
ce426f |
+#endif
|
|
|
ce426f |
+
|
|
|
ce426f |
+
|
|
|
ce426f |
+/* Structure describing a signal stack (obsolete). */
|
|
|
ce426f |
+struct sigstack
|
|
|
ce426f |
+ {
|
|
|
ce426f |
+ void *ss_sp; /* Signal stack pointer. */
|
|
|
ce426f |
+ int ss_onstack; /* Nonzero if executing on this stack. */
|
|
|
ce426f |
+ };
|
|
|
ce426f |
+
|
|
|
ce426f |
+
|
|
|
ce426f |
+/* Possible values for `ss_flags.'. */
|
|
|
ce426f |
+enum
|
|
|
ce426f |
+{
|
|
|
ce426f |
+ SS_ONSTACK = 1,
|
|
|
ce426f |
+#define SS_ONSTACK SS_ONSTACK
|
|
|
ce426f |
+ SS_DISABLE
|
|
|
ce426f |
+#define SS_DISABLE SS_DISABLE
|
|
|
ce426f |
+};
|
|
|
ce426f |
+
|
|
|
ce426f |
+/* Minimum stack size for a signal handler. */
|
|
|
ce426f |
+#define MINSIGSTKSZ 4096
|
|
|
ce426f |
+
|
|
|
ce426f |
+/* System default stack size. */
|
|
|
ce426f |
+#define SIGSTKSZ 16384
|
|
|
ce426f |
+
|
|
|
ce426f |
+
|
|
|
ce426f |
+/* Alternate, preferred interface. */
|
|
|
ce426f |
+typedef struct sigaltstack
|
|
|
ce426f |
+ {
|
|
|
ce426f |
+ void *ss_sp;
|
|
|
ce426f |
+ int ss_flags;
|
|
|
ce426f |
+ size_t ss_size;
|
|
|
ce426f |
+ } stack_t;
|