This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.18-757-g87ded0c


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  87ded0c382b835e5d7ca8b5e059a8a044a6c3976 (commit)
       via  c5eebdd084b77b0b581a3aa02213fa7cc5851216 (commit)
       via  05d138ef07481b16f1aaee648798cc51182ec65e (commit)
       via  93a45ff1ca6d459618bb0cf93580c4b2809a4b61 (commit)
      from  d5780febe69c2fe42d857e2feed54e9f4ba9ab87 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=87ded0c382b835e5d7ca8b5e059a8a044a6c3976

commit 87ded0c382b835e5d7ca8b5e059a8a044a6c3976
Author: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Date:   Tue Jan 7 09:40:39 2014 +0100

    S/390: Remove __tls_get_addr argument cast.

diff --git a/ChangeLog b/ChangeLog
index bb3786b..50dd9b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2014-01-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
+	* sysdeps/s390/dl-tls.h: sysdeps/s390/dl-tls.h: Remove casts for
+	the first argument and return value of __tls_get_addr_internal.
+
+2014-01-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
 	* sysdeps/s390/s390-32/dl-machine.h: Gate the definition of refsym
 	also with !RTLD_BOOTSTRAP to get rid of unused variable warning.
 
diff --git a/sysdeps/s390/dl-tls.h b/sysdeps/s390/dl-tls.h
index acf282e..4801bf8 100644
--- a/sysdeps/s390/dl-tls.h
+++ b/sysdeps/s390/dl-tls.h
@@ -91,7 +91,7 @@ extern void *__tls_get_addr_internal (tls_index *ti);
    compiler will take care of setting up r12 only if itself issued the
    __tls_get_offset call.  */
 # define __TLS_GET_ADDR(__ti)					\
-  ({ (void *) __tls_get_addr_internal ((char *) (__ti))		\
+  ({ __tls_get_addr_internal (__ti)				\
       + (unsigned long) __builtin_thread_pointer (); })
 
 #endif

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c5eebdd084b77b0b581a3aa02213fa7cc5851216

commit c5eebdd084b77b0b581a3aa02213fa7cc5851216
Author: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Date:   Tue Jan 7 09:40:00 2014 +0100

    S/390: Get rid of unused variable warning in dl-machine.h

diff --git a/ChangeLog b/ChangeLog
index a8b62e0..bb3786b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2014-01-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
+	* sysdeps/s390/s390-32/dl-machine.h: Gate the definition of refsym
+	also with !RTLD_BOOTSTRAP to get rid of unused variable warning.
+
+2014-01-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
 	* sysdeps/s390/Makefile: Build rtld-global-offsets.sym.
 	* sysdeps/s390/rtld-global-offsets.sym: New file.
 	* sysdeps/unix/sysv/linux/s390/Versions: Add getcontext as new
diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h
index 100101e..928581e 100644
--- a/sysdeps/s390/s390-32/dl-machine.h
+++ b/sysdeps/s390/s390-32/dl-machine.h
@@ -299,7 +299,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
     return;
   else
     {
-#ifndef RESOLVE_CONFLICT_FIND_MAP
+#if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP
+      /* Only needed for R_390_COPY below.  */
       const Elf32_Sym *const refsym = sym;
 #endif
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=05d138ef07481b16f1aaee648798cc51182ec65e

commit 05d138ef07481b16f1aaee648798cc51182ec65e
Author: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Date:   Tue Jan 7 09:37:31 2014 +0100

    S/390: Make ucontext_t extendible.

diff --git a/ChangeLog b/ChangeLog
index d6c0ddb..a8b62e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,43 @@
 2014-01-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
+	* sysdeps/s390/Makefile: Build rtld-global-offsets.sym.
+	* sysdeps/s390/rtld-global-offsets.sym: New file.
+	* sysdeps/unix/sysv/linux/s390/Versions: Add getcontext as new
+	GLIBC_2.19 symbol.
+	* sysdeps/unix/sysv/linux/s390/getcontext.S: New file.
+	* sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S: Rename to ...
+	* sysdeps/unix/sysv/linux/s390/s390-32/getcontext-common.S:
+	... this.
+	* sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S: Rename to ...
+	* sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S:
+	... this.
+	* sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist:
+	Regenerate.
+	* sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist:
+	Regenerate.
+	* sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S: Restore upper
+	halfs of GPRs for high_gprs contexts.
+	* sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S: Save and
+	restore upper halfs of GPRs for high_gprs contexts.  Copy uc_flags
+	field.
+	* sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S: Copy
+	uc_flags field.
+	* sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Split into 32 and
+	64 bit versions:
+	* sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h: Add field
+	for high GPRs (uc_high_gprs) and for future extensions
+	(__reserved).
+	* sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h: Add field
+	for future extensions (__reserved).
+	* sysdeps/unix/sysv/linux/s390/ucontext_i.sym: Split into 32 and
+	64 bit versions:
+	* sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.sym: Add
+	SC_HIGHGPRS offset definition.
+	* sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.sym: New file.
+	* sysdeps/unix/sysv/linux/s390/rtld-getcontext.S: New file.
+
+2014-01-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
 	* Versions.def: Add GLIBC_2.19 for libpthread.
 	* nptl/sysdeps/unix/sysv/linux/s390/Versions: Add longjmp and
 	siglongjmp for libpthread with GLIBC_2.19 symver.
diff --git a/sysdeps/s390/Makefile b/sysdeps/s390/Makefile
index fdc6ee5..42978dc 100644
--- a/sysdeps/s390/Makefile
+++ b/sysdeps/s390/Makefile
@@ -3,3 +3,7 @@ ifeq (yes,$(build-shared))
 sysdep_routines += v1-longjmp v1-sigjmp
 endif
 endif
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += rtld-global-offsets.sym
+endif
diff --git a/sysdeps/s390/rtld-global-offsets.sym b/sysdeps/s390/rtld-global-offsets.sym
new file mode 100644
index 0000000..ff4e97f
--- /dev/null
+++ b/sysdeps/s390/rtld-global-offsets.sym
@@ -0,0 +1,7 @@
+#define SHARED 1
+
+#include <ldsodefs.h>
+
+#define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem)
+
+RTLD_GLOBAL_RO_DL_HWCAP_OFFSET	rtld_global_ro_offsetof (_dl_hwcap)
diff --git a/sysdeps/unix/sysv/linux/s390/Versions b/sysdeps/unix/sysv/linux/s390/Versions
index 9577823..f71a6bd 100644
--- a/sysdeps/unix/sysv/linux/s390/Versions
+++ b/sysdeps/unix/sysv/linux/s390/Versions
@@ -1,6 +1,7 @@
 libc {
   GLIBC_2.19 {
     __longjmp_chk;
+    getcontext;
   }
   GLIBC_PRIVATE {
     __vdso_clock_gettime;
diff --git a/sysdeps/unix/sysv/linux/s390/getcontext.S b/sysdeps/unix/sysv/linux/s390/getcontext.S
new file mode 100644
index 0000000..5edbf95
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/getcontext.S
@@ -0,0 +1,38 @@
+/* Extendible version of getcontext for System z
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <libc-symbols.h>
+#include <shlib-compat.h>
+
+versioned_symbol (libc, __v2getcontext, getcontext, GLIBC_2_19)
+#define __getcontext __v2getcontext
+
+#include "getcontext-common.S"
+
+#undef __getcontext
+
+libc_hidden_ver (__v2getcontext, getcontext)
+
+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_19)
+# define __V1_UCONTEXT
+compat_symbol (libc, __v1getcontext, getcontext, GLIBC_2_1)
+# define __getcontext __v1getcontext
+# include "getcontext-common.S"
+# undef __getcontext
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/rtld-getcontext.S b/sysdeps/unix/sysv/linux/s390/rtld-getcontext.S
new file mode 100644
index 0000000..653f2b6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/rtld-getcontext.S
@@ -0,0 +1,19 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Build a non-versioned object for rtld-*.  */
+#include "getcontext-common.S"
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S b/sysdeps/unix/sysv/linux/s390/s390-32/getcontext-common.S
similarity index 65%
rename from sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
rename to sysdeps/unix/sysv/linux/s390/s390-32/getcontext-common.S
index ce2d994..4992030 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/getcontext-common.S
@@ -19,6 +19,7 @@
 #include <sysdep.h>
 #include <features.h>
 
+#include "rtld-global-offsets.h"
 #include "ucontext_i.h"
 
 /*  __getcontext (const ucontext_t *ucp)
@@ -33,10 +34,10 @@
 ENTRY(__getcontext)
 	lr      %r1,%r2
 
-	/* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask).  */
+	/* rt_sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask, sigsetsize).  */
 	la      %r2,SIG_BLOCK
 	slr	%r3,%r3
-	la	%r4,SC_MASK(%r1)
+	la      %r4,SC_MASK(%r1)
 	lhi	%r5,_NSIG8
 	svc	SYS_ify(rt_sigprocmask)
 
@@ -59,6 +60,42 @@ ENTRY(__getcontext)
 	std     %f14,SC_FPRS+112(%r1)
 	std     %f15,SC_FPRS+120(%r1)
 
+	lhi	%r2,0
+#ifndef __V1_UCONTEXT
+	bras	%r3,0f
+# ifdef IS_IN_rtld
+  /* Within ld.so we can do slightly better by addressing dl_hwap
+     relative to GOT start.  */
+1:	.long	_GLOBAL_OFFSET_TABLE_ - 1b
+	.long	C_SYMBOL_NAME(_rtld_global_ro)@GOTOFF
+0:	l	%r4,0(%r3)
+	la	%r4,0(%r3,%r4)
+	l	%r5,4(%r3)
+	/* _dl_hwcap is 64 bit and we need the lower 32.  */
+	l	%r3,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(%r4,%r5)
+# elif PIC
+1:	.long	_GLOBAL_OFFSET_TABLE_ - 1b
+	.long	C_SYMBOL_NAME(_rtld_global_ro)@GOT
+0:	l	%r4,0(%r3)
+	la	%r4,0(%r3,%r4)  /* GOT pointer -> r4 */
+	l	%r5,4(%r3)      /* GOT offset -> r5 */
+	l	%r5,0(%r4,%r5)  /* GOT slot -> r5 */
+	l	%r3,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(%r5)
+# else
+	.long	C_SYMBOL_NAME(_dl_hwcap)
+0:	l	%r3,0(%r3)
+	l	%r3,0(%r3)
+# endif
+	tml	%r3,512 /* HWCAP_S390_HIGH_GPRS */
+	jz	2f
+	/* highgprs implies zarch so stmh/oill is ok here.  */
+	.machine "z900"
+	.machinemode "zarch_nohighgprs"
+	stmh	%r0,%r15,SC_HIGHGPRS(%r1)
+	oill	%r2,1 /* UCONTEXT_UC_FLAGS_HIGH_GPRS */
+#endif
+2:	st	%r2,SC_FLGS(%r1)
+
 	/* Set __getcontext return value to 0.  */
 	slr     %r2,%r2
 
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
index 18ec994..03f2e83 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
@@ -1781,6 +1781,7 @@ GLIBC_2.19
  __sigsetjmp F
  _longjmp F
  _setjmp F
+ getcontext F
  longjmp F
  setjmp F
  siglongjmp F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S b/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
index 3008f8e..fbe8b77 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
@@ -33,7 +33,7 @@
 ENTRY(__setcontext)
 	lr	%r1,%r2
 
-	/* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL).  */
+	/* rt_sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL, sigsetsize).  */
 	la      %r2,SIG_BLOCK
 	la	%r3,SC_MASK(%r1)
 	slr	%r4,%r4
@@ -62,8 +62,16 @@ ENTRY(__setcontext)
 	/* Don't touch %a0, used for thread purposes.  */
 	lam	%a1,%a15,SC_ACRS+4(%r1)
 
+	/* Restore the upper halfs if available.  */
+	l	%r2,SC_FLGS(%r1)
+	tml	%r2,1   /* UCONTEXT_UC_FLAGS_HIGH_GPRS */
+	jz	0f
+	.machine	"z900"
+	.machinemode	"zarch_nohighgprs"
+	lmh	%r0,%r15,SC_HIGHGPRS(%r1)
+
 	/* Load general purpose registers.  */
-	lm	%r0,%r15,SC_GPRS(%r1)
+0:	lm	%r0,%r15,SC_GPRS(%r1)
 
 	/* Return.  */
 	br	%r14
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S b/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
index 6c40c99..41ede4b 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
@@ -33,6 +33,9 @@
   other than the PRESERVED state.  */
 
 ENTRY(__swapcontext)
+	/* While not part of the ABI a system call never clobbers r0
+	   or r1.  So keeping the values here while calling
+	   rt_sigprocmask is ok.  */
 	lr	%r1,%r2
 	lr      %r0,%r3
 
@@ -62,19 +65,31 @@ ENTRY(__swapcontext)
 	std     %f14,SC_FPRS+112(%r1)
 	std     %f15,SC_FPRS+120(%r1)
 
-	/* Set __swapcontext return value to 0.  */
-	slr     %r2,%r2
-
 	/* Store access registers.  */
 	stam    %a0,%a15,SC_ACRS(%r1)
 
+	/* Set __swapcontext return value to 0.  */
+	slr     %r2,%r2
+
 	/* Store general purpose registers.  */
 	stm     %r0,%r15,SC_GPRS(%r1)
 
-	/* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL).  */
-	la      %r2,SIG_BLOCK
+	/* Copy uc_flags into the new ucontext_t.  */
 	lr	%r5,%r0
-	la	%r3,SC_MASK(%r5)
+	l	%r2,SC_FLGS(%r5)
+	st	%r2,SC_FLGS(%r1)
+
+	/* Save/restore the upper halfs if necessary.  */
+	tml	%r2,1   /* UCONTEXT_UC_FLAGS_HIGH_GPRS */
+	jz	0f
+	.machine	"z900"
+	.machinemode	"zarch_nohighgprs"
+	stmh	%r0,%r15,SC_HIGHGPRS(%r1)
+	lmh	%r0,%r15,SC_HIGHGPRS(%r5)
+
+	/* rt_sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL, sigsetsize).  */
+0:	la      %r2,SIG_BLOCK
+	la      %r3,SC_MASK(%r5)
 	slr	%r4,%r4
 	lhi	%r5,_NSIG8
 	svc	SYS_ify(rt_sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h b/sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h
similarity index 85%
copy from sysdeps/unix/sysv/linux/s390/sys/ucontext.h
copy to sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h
index d528cb1..90adc2d 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2013 Free Software Foundation, Inc.
    Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
    This file is part of the GNU C Library.
 
@@ -64,6 +64,13 @@ typedef struct
     fpreg_t fprs[16];
   } fpregset_t;
 
+/* Bit is set if the uc_high_gprs field contains the upper halfs of
+   the 64 bit general purpose registers.  */
+#define UCONTEXT_UC_FLAGS_HIGH_GPRS (1UL << 0)
+
+/* A new uc_flags constant will be defined when actually making use of
+   the reserved space: UCONTEXT_UCFLAGS_RESERVED (1UL << 1).  */
+
 /* Context to describe whole processor state.  */
 typedef struct
   {
@@ -81,6 +88,8 @@ struct ucontext
     stack_t uc_stack;
     mcontext_t uc_mcontext;
     __sigset_t uc_sigmask;
+    unsigned long uc_high_gprs[16];
+    char __reserved[512];
   };
 
 
diff --git a/sysdeps/unix/sysv/linux/s390/ucontext_i.sym b/sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.sym
similarity index 93%
copy from sysdeps/unix/sysv/linux/s390/ucontext_i.sym
copy to sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.sym
index 6cc9f19..705c7ab 100644
--- a/sysdeps/unix/sysv/linux/s390/ucontext_i.sym
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.sym
@@ -23,3 +23,4 @@ SC_ACRS		mcontext (aregs)
 SC_FPC		mcontext (fpregs.fpc)
 SC_FPRS		mcontext (fpregs.fprs)
 SC_MASK		ucontext (uc_sigmask)
+SC_HIGHGPRS	ucontext (uc_high_gprs)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S
similarity index 90%
rename from sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
rename to sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S
index db271c5..3e61e30 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S
@@ -33,7 +33,7 @@
 ENTRY(__getcontext)
 	lgr     %r1,%r2
 
-	/* sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask).  */
+	/* rt_sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask, sigsetsize).  */
 	la      %r2,SIG_BLOCK
 	slgr	%r3,%r3
 	la	%r4,SC_MASK(%r1)
@@ -62,6 +62,10 @@ ENTRY(__getcontext)
 	/* Set __getcontext return value to 0.  */
 	slgr    %r2,%r2
 
+	/* Store the version number into the uc_flags field.  So far
+	   we do not make use of the reserved bytes so we store a zero.  */
+	stg	%r2,SC_FLGS(%r1)
+
 	/* Store access registers.  */
 	stam    %a0,%a15,SC_ACRS(%r1)
 
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
index 05b5286..4576fc8 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
@@ -102,6 +102,7 @@ GLIBC_2.19
  __sigsetjmp F
  _longjmp F
  _setjmp F
+ getcontext F
  longjmp F
  setjmp F
  siglongjmp F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S b/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
index ec92898..ac74b6b 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
@@ -33,6 +33,9 @@
   other than the PRESERVED state.  */
 
 ENTRY(__swapcontext)
+	/* While not part of the ABI a system call never clobbers r0
+	   or r1.  So keeping the values here while calling
+	   rt_sigprocmask is ok.  */
 	lgr	%r1,%r2
 	lgr     %r0,%r3
 
@@ -62,21 +65,25 @@ ENTRY(__swapcontext)
 	std     %f14,SC_FPRS+112(%r1)
 	std     %f15,SC_FPRS+120(%r1)
 
-	/* Set __swapcontext return value to 0.  */
-	slgr     %r2,%r2
-
 	/* Store access registers.  */
 	stam    %a0,%a15,SC_ACRS(%r1)
 
+	/* Set __swapcontext return value to 0.  */
+	slgr	%r2,%r2
+
 	/* Store general purpose registers.  */
 	stmg    %r0,%r15,SC_GPRS(%r1)
 
-	/* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL).  */
-	la      %r2,SIG_BLOCK
+	/* Copy uc_flags into the new ucontext_t.  */
 	lgr	%r5,%r0
+	lg	%r2,SC_FLGS(%r5)
+	stg	%r2,SC_FLGS(%r1)
+
+	/* rt_sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL, sigsetsize).  */
+	la      %r2,SIG_BLOCK
 	la	%r3,SC_MASK(%r5)
-	lghi	%r5,_NSIG8
 	slgr	%r4,%r4
+	lghi	%r5,_NSIG8
 	svc	SYS_ify(rt_sigprocmask)
 
 	/* Load fpu context.  */
diff --git a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h b/sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h
similarity index 87%
rename from sysdeps/unix/sysv/linux/s390/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h
index d528cb1..b563e98 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h
@@ -64,6 +64,14 @@ typedef struct
     fpreg_t fprs[16];
   } fpregset_t;
 
+/* Bit 0 is reserved for the uc_high_gprs field only available in the
+   32 bit version of ucontext_t.  This bit will never be set for 64
+   bit.  */
+#define UCONTEXT_UC_FLAGS_HIGH_GPRS (1UL << 0)
+
+/* A new uc_flags constant will be defined when actually making use of
+   the reserved space: UCONTEXT_UCFLAGS_RESERVED (1UL << 1).  */
+
 /* Context to describe whole processor state.  */
 typedef struct
   {
@@ -81,6 +89,7 @@ struct ucontext
     stack_t uc_stack;
     mcontext_t uc_mcontext;
     __sigset_t uc_sigmask;
+    char reserved[512];
   };
 
 
diff --git a/sysdeps/unix/sysv/linux/s390/ucontext_i.sym b/sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.sym
similarity index 100%
rename from sysdeps/unix/sysv/linux/s390/ucontext_i.sym
rename to sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.sym

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=93a45ff1ca6d459618bb0cf93580c4b2809a4b61

commit 93a45ff1ca6d459618bb0cf93580c4b2809a4b61
Author: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Date:   Tue Jan 7 09:36:31 2014 +0100

    S/390: Make jmp_buf extendible.

diff --git a/ChangeLog b/ChangeLog
index 8bdea17..d6c0ddb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,47 @@
+2014-01-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+	* Versions.def: Add GLIBC_2.19 for libpthread.
+	* nptl/sysdeps/unix/sysv/linux/s390/Versions: Add longjmp and
+	siglongjmp for libpthread with GLIBC_2.19 symver.
+	* nptl/sysdeps/unix/sysv/linux/s390/pt-longjmp.c: New file.
+	* sysdeps/s390/Makefile: Build v1-longjmp.c and v1-sigjmp.c.
+	* sysdeps/s390/Versions: New GLIBC_2.19 and GLIBC_PRIVATE symbols.
+	* sysdeps/s390/__longjmp.c: New file.
+	* sysdeps/s390/bits/setjmp.h: Add new fields to __s390_jmp_buf.
+	* sysdeps/s390/longjmp.c: New file.
+	* sysdeps/s390/setjmp.S: New file.
+	* sysdeps/s390/sigjmp.S: New file.
+	* sysdeps/s390/v1-longjmp.c: New file.
+	* sysdeps/s390/v1-setjmp.h: New file.
+	* sysdeps/s390/v1-sigjmp.c: New file.
+	* sysdeps/unix/sysv/linux/s390/Makefile: Build __longjmp_chk.
+	* sysdeps/unix/sysv/linux/s390/Versions: Add __longjmp_chk with
+	GLIBC_2.19 version.
+	* sysdeps/unix/sysv/linux/s390/longjmp_chk.c: New file.
+	* sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c: Provide
+	versioned symbols for ____longjmp_chk.
+	* sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c:
+	Likewise.
+	* sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist:
+	Regenerate.
+	* sysdeps/unix/sysv/linux/s390/s390-32/nptl/libpthread.abilist:
+	Regenerate.
+	* sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist:
+	Regenerate.
+	* sysdeps/unix/sysv/linux/s390/s390-64/nptl/libpthread.abilist:
+	Regenerate.
+	* sysdeps/unix/sysv/linux/s390/v1-longjmp_chk.c: New file.
+	* sysdeps/s390/s390-32/__longjmp.c: Rename to ...
+	* sysdeps/s390/s390-32/__longjmp-common.c: ... this.
+	* sysdeps/s390/s390-32/setjmp.S: Rename and adjust to ...
+	* sysdeps/s390/s390-32/setjmp-common.S: ... this.
+	* sysdeps/s390/s390-64/__longjmp.c: Rename to ...
+	* sysdeps/s390/s390-64/__longjmp-common.c: ... this.
+	* sysdeps/s390/s390-64/setjmp.S: Rename and adjust to ...
+	* sysdeps/s390/s390-64/setjmp-common.S: ... this.
+	* sysdeps/s390/rtld-__longjmp.c: New file.
+	* sysdeps/s390/rtld-setjmp.S: New file.
+
 2014-01-06  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #16400]
diff --git a/Versions.def b/Versions.def
index d834b10..759c754 100644
--- a/Versions.def
+++ b/Versions.def
@@ -106,6 +106,7 @@ libpthread {
   GLIBC_2.11
   GLIBC_2.12
   GLIBC_2.18
+  GLIBC_2.19
   GLIBC_PRIVATE
 }
 libresolv {
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/Versions b/nptl/sysdeps/unix/sysv/linux/s390/Versions
new file mode 100644
index 0000000..58632f4
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/s390/Versions
@@ -0,0 +1,5 @@
+libpthread {
+  GLIBC_2.19 {
+    longjmp; siglongjmp;
+  }
+}
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/pt-longjmp.c b/nptl/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
new file mode 100644
index 0000000..801432c
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.
+
+   This is a copy of pthread/pt-longjmp.c made for extending the
+   jmpbuf structure on System z.  */
+
+#include <setjmp.h>
+#include <stdlib.h>
+#include <bits/wordsize.h>
+#include "pthreadP.h"
+#include  <shlib-compat.h>
+#if defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_19)
+
+/* The __v1 version prototypes are declared in v1-setjmp.h which
+   cannot be included together with setjmp.h.  So we put the
+   prototypes here manually.  */
+extern void __v1__libc_siglongjmp (sigjmp_buf env, int val)
+     __attribute__ ((noreturn));
+extern void __v1__libc_longjmp (sigjmp_buf env, int val)
+     __attribute__ ((noreturn));
+
+void __v1_siglongjmp (sigjmp_buf env, int val)
+{
+  __v1__libc_siglongjmp (env, val);
+}
+
+void __v1_longjmp (jmp_buf env, int val)
+{
+  __v1__libc_longjmp (env, val);
+}
+
+compat_symbol (libpthread, __v1_longjmp, longjmp, GLIBC_2_0);
+compat_symbol (libpthread, __v1_siglongjmp, siglongjmp, GLIBC_2_0);
+#endif /* defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_19))  */
+
+void
+__v2_longjmp (jmp_buf env, int val)
+{
+  __libc_longjmp (env, val);
+}
+
+void
+__v2_siglongjmp (jmp_buf env, int val)
+{
+  __libc_siglongjmp (env, val);
+}
+
+versioned_symbol (libpthread, __v2_longjmp, longjmp, GLIBC_2_19);
+versioned_symbol (libpthread, __v2_siglongjmp, siglongjmp, GLIBC_2_19);
diff --git a/sysdeps/s390/Makefile b/sysdeps/s390/Makefile
new file mode 100644
index 0000000..fdc6ee5
--- /dev/null
+++ b/sysdeps/s390/Makefile
@@ -0,0 +1,5 @@
+ifeq ($(subdir),setjmp)
+ifeq (yes,$(build-shared))
+sysdep_routines += v1-longjmp v1-sigjmp
+endif
+endif
diff --git a/sysdeps/s390/Versions b/sysdeps/s390/Versions
index baf9842..156abc7 100644
--- a/sysdeps/s390/Versions
+++ b/sysdeps/s390/Versions
@@ -1,3 +1,14 @@
+libc {
+  GLIBC_2.19 {
+    setjmp; _setjmp; __setjmp; __sigsetjmp;
+    longjmp; _longjmp; siglongjmp;
+  }
+  GLIBC_PRIVATE {
+    __v1__libc_longjmp; __v1__libc_siglongjmp;
+    __v2__libc_longjmp; __v2__libc_siglongjmp;
+  }
+}
+
 ld {
   GLIBC_2.3 {
     # runtime interface to TLS
diff --git a/sysdeps/s390/bits/setjmp.h b/sysdeps/s390/__longjmp.c
similarity index 52%
copy from sysdeps/s390/bits/setjmp.h
copy to sysdeps/s390/__longjmp.c
index 0071a9d..e4acd31 100644
--- a/sysdeps/s390/bits/setjmp.h
+++ b/sysdeps/s390/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -15,33 +15,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-/* Define the machine-dependent type `jmp_buf'.  IBM s390 version.  */
+#include <libc-symbols.h>
+#include <shlib-compat.h>
 
-#ifndef __S390_SETJMP_H__
-#define __S390_SETJMP_H__
+#define __longjmp  __v2__longjmp
+#include "__longjmp-common.c"
+#undef __longjmp
+strong_alias (__v2__longjmp, __longjmp)
 
-#if !defined _SETJMP_H && !defined _PTHREAD_H
-# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
-#endif
-
-#include <bits/wordsize.h>
-
-#ifndef	_ASM
-
-typedef struct __s390_jmp_buf
-{
-  /* We save registers 6-15.  */
-  long int __gregs[10];
-
-# if __WORDSIZE == 64
-  /* We save fpu registers f8 - f15.  */
-  long __fpregs[8];
-# else
-  /* We save fpu registers 4 and 6.  */
-  long __fpregs[4];
-# endif
-} __jmp_buf[1];
-
-#endif
-
-#endif /* __S390_SETJMP_H__ */
+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19)
+# undef __longjmp
+# define __V1_JMPBUF
+# define __longjmp  __v1__longjmp
+# include "__longjmp-common.c"
+#endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) */
diff --git a/sysdeps/s390/bits/setjmp.h b/sysdeps/s390/bits/setjmp.h
index 0071a9d..25eaf10 100644
--- a/sysdeps/s390/bits/setjmp.h
+++ b/sysdeps/s390/bits/setjmp.h
@@ -40,6 +40,10 @@ typedef struct __s390_jmp_buf
   /* We save fpu registers 4 and 6.  */
   long __fpregs[4];
 # endif
+#ifndef __V1_JMPBUF
+  unsigned long __flags;
+  char __reserved[128];
+#endif
 } __jmp_buf[1];
 
 #endif
diff --git a/sysdeps/s390/longjmp.c b/sysdeps/s390/longjmp.c
new file mode 100644
index 0000000..c758d14
--- /dev/null
+++ b/sysdeps/s390/longjmp.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.
+
+   Versioned copy of sysdeps/generic/longjmp.c modified for extended
+   jmpbuf.  */
+
+#include <shlib-compat.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <signal.h>
+
+extern void __v2__longjmp (__jmp_buf __env, int __val)
+     __attribute__ ((__noreturn__));
+extern void __v2__libc_longjmp (sigjmp_buf env, int val)
+     __attribute__ ((__noreturn__));
+libc_hidden_proto (__v2__libc_longjmp)
+
+/* Set the signal mask to the one specified in ENV, and jump
+   to the position specified in ENV, causing the setjmp
+   call there to return VAL, or 1 if VAL is 0.  */
+void
+__v2__libc_siglongjmp (sigjmp_buf env, int val)
+{
+  /* Perform any cleanups needed by the frames being unwound.  */
+  _longjmp_unwind (env, val);
+
+  if (env[0].__mask_was_saved)
+    /* Restore the saved signal mask.  */
+    (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
+			  (sigset_t *) NULL);
+
+  /* Call the machine-dependent function to restore machine state.  */
+  __v2__longjmp (env[0].__jmpbuf, val ?: 1);
+}
+
+#ifndef __v2__longjmp
+strong_alias (__v2__libc_siglongjmp, __v2__libc_longjmp)
+libc_hidden_def (__v2__libc_longjmp)
+weak_alias (__v2__libc_siglongjmp, __v2_longjmp)
+weak_alias (__v2__libc_siglongjmp, __v2longjmp)
+weak_alias (__v2__libc_siglongjmp, __v2siglongjmp)
+
+/* These will be used by libpthread only.  */
+versioned_symbol (libc, __v2__libc_longjmp, __libc_longjmp, GLIBC_PRIVATE);
+versioned_symbol (libc, __v2__libc_siglongjmp, __libc_siglongjmp, GLIBC_PRIVATE);
+
+versioned_symbol (libc, __v2_longjmp, _longjmp, GLIBC_2_19);
+versioned_symbol (libc, __v2longjmp, longjmp, GLIBC_2_19);
+versioned_symbol (libc, __v2siglongjmp, siglongjmp, GLIBC_2_19);
+#endif /* ifndef __v2__longjmp */
diff --git a/sysdeps/s390/rtld-__longjmp.c b/sysdeps/s390/rtld-__longjmp.c
new file mode 100644
index 0000000..5e9f739
--- /dev/null
+++ b/sysdeps/s390/rtld-__longjmp.c
@@ -0,0 +1,19 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Build a non-versioned object for rtld-*.  */
+# include "__longjmp-common.c"
diff --git a/sysdeps/s390/rtld-setjmp.S b/sysdeps/s390/rtld-setjmp.S
new file mode 100644
index 0000000..4011011
--- /dev/null
+++ b/sysdeps/s390/rtld-setjmp.S
@@ -0,0 +1,20 @@
+/* Extendible version of setjmp for System z
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Build a non-versioned object for rtld-*.  */
+# include "setjmp-common.S"
diff --git a/sysdeps/s390/s390-32/__longjmp.c b/sysdeps/s390/s390-32/__longjmp-common.c
similarity index 98%
rename from sysdeps/s390/s390-32/__longjmp.c
rename to sysdeps/s390/s390-32/__longjmp-common.c
index 5d46e21..f78ef65 100644
--- a/sysdeps/s390/s390-32/__longjmp.c
+++ b/sysdeps/s390/s390-32/__longjmp-common.c
@@ -25,7 +25,7 @@
 
 /* Jump to the position specified by ENV, causing the
    setjmp call there to return VAL, or 1 if VAL is 0.  */
-void
+attribute_hidden void
 __longjmp (__jmp_buf env, int val)
 {
 #ifdef PTR_DEMANGLE
diff --git a/sysdeps/s390/s390-32/setjmp.S b/sysdeps/s390/s390-32/setjmp-common.S
similarity index 78%
rename from sysdeps/s390/s390-32/setjmp.S
rename to sysdeps/s390/s390-32/setjmp-common.S
index b8a0296..d7bb720 100644
--- a/sysdeps/s390/s390-32/setjmp.S
+++ b/sysdeps/s390/s390-32/setjmp-common.S
@@ -27,24 +27,24 @@
 ENTRY (setjmp)
 	.weak C_SYMBOL_NAME (setjmp)
 	lhi    %r3,1                /* second argument of one */
-	j      .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */
+	j      0f                   /* branch relativ to __sigsetjmp */
 END (setjmp)
 
 	/* Binary compatibility entry point.  */
 ENTRY(_setjmp)
 	.weak  C_SYMBOL_NAME (_setjmp)
 	lhi    %r3,0                /* second argument of zero */
-	j      .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */
+	j      0f                   /* branch relativ to __sigsetjmp */
 END (_setjmp)
 libc_hidden_def (_setjmp)
 
 ENTRY(__setjmp)
 	lhi    %r3,0                /* second argument of zero */
-	j      .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */
+	j      0f                   /* branch relativ to __sigsetjmp */
 END (__setjmp)
 
 ENTRY(__sigsetjmp)
-.Linternal_sigsetjmp:
+0:
 #ifdef PTR_MANGLE
 	stm    %r6,%r13,0(%r2)      /* store registers in jmp_buf */
 	lr     %r4,%r14
@@ -55,6 +55,10 @@ ENTRY(__sigsetjmp)
 #else
 	stm    %r6,%r15,0(%r2)      /* store registers in jmp_buf */
 #endif
+#ifndef __V1_JMPBUF
+	lhi    %r4,0
+	st     %r4,56(%r2)         /* Set __flags to 0.  */
+#endif
 	std    %f4,40(%r2)
 	std    %f6,48(%r2)
 #if defined NOT_IN_libc && defined IS_IN_rtld
@@ -66,15 +70,15 @@ ENTRY(__sigsetjmp)
 	   we can't save and restore our caller's value.  Instead, we do an
 	   indirect jump through the GOT. */
 	basr   %r1,0
-.L0:    al     %r1,.L1 - .L0(0,%r1) /* get address of global offset table */
-				    /* get address of __sigjmp_save from got */
+0:      al     %r1,1f-0b(0,%r1) /* get address of global offset table */
+				/* get address of __sigjmp_save from got */
 	l      %r1,__sigjmp_save@GOT12(0,%r1)
 	br     %r1
-.L1:    .long  _GLOBAL_OFFSET_TABLE_ - .L0
+1:      .long  _GLOBAL_OFFSET_TABLE_ - 0b
 #else
 	basr   %r1,0
-.L0:    l      %r1,.L1-.L0(0,%r1)   /* load address of __sigjmp_save */
-	br     %r1                  /* tail-call __sigjmp_save */
-.L1:    .long  __sigjmp_save
+0:      l      %r1,1f-0b(0,%r1)   /* load address of __sigjmp_save */
+	br     %r1                /* tail-call __sigjmp_save */
+1:      .long  __sigjmp_save
 #endif
 END (__sigsetjmp)
diff --git a/sysdeps/s390/s390-64/__longjmp.c b/sysdeps/s390/s390-64/__longjmp-common.c
similarity index 98%
rename from sysdeps/s390/s390-64/__longjmp.c
rename to sysdeps/s390/s390-64/__longjmp-common.c
index 168ebf5..46cabb6 100644
--- a/sysdeps/s390/s390-64/__longjmp.c
+++ b/sysdeps/s390/s390-64/__longjmp-common.c
@@ -25,7 +25,7 @@
 
 /* Jump to the position specified by ENV, causing the
    setjmp call there to return VAL, or 1 if VAL is 0.  */
-void
+attribute_hidden void
 __longjmp (__jmp_buf env, int val)
 {
 #ifdef PTR_DEMANGLE
diff --git a/sysdeps/s390/s390-64/setjmp.S b/sysdeps/s390/s390-64/setjmp-common.S
similarity index 87%
rename from sysdeps/s390/s390-64/setjmp.S
rename to sysdeps/s390/s390-64/setjmp-common.S
index 5462dab..9cdcae4 100644
--- a/sysdeps/s390/s390-64/setjmp.S
+++ b/sysdeps/s390/s390-64/setjmp-common.S
@@ -27,24 +27,24 @@
 ENTRY (setjmp)
 	.weak C_SYMBOL_NAME (setjmp)
         lghi   %r3,1                /* Second argument of one.  */
-        j      .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp.  */
+        j      0f                   /* Branch relativ to __sigsetjmp.  */
 END (setjmp)
 
 	/* Binary compatibility entry point.  */
 ENTRY(_setjmp)
         .weak  C_SYMBOL_NAME (_setjmp)
         slgr   %r3,%r3              /* Second argument of zero.  */
-        j      .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp.  */
-END (setjmp)
+        j      0f                   /* Branch relativ to __sigsetjmp.  */
+END (_setjmp)
 libc_hidden_def (_setjmp)
 
 ENTRY(__setjmp)
         slgr   %r3,%r3              /* Second argument of zero.  */
-        j      .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp.  */
-END (setjmp)
+        j      0f                   /* Branch relativ to __sigsetjmp.  */
+END (__setjmp)
 
 ENTRY(__sigsetjmp)
-.Linternal_sigsetjmp:
+0:
 #ifdef PTR_MANGLE
 	stmg   %r6,%r13,0(%r2)      /* Store registers in jmp_buf.  */
 	lgr    %r4,%r14
@@ -55,6 +55,10 @@ ENTRY(__sigsetjmp)
 #else
         stmg   %r6,%r15,0(%r2)      /* Store registers in jmp_buf.  */
 #endif
+#ifndef __V1_JMPBUF
+	lghi   %r4,0
+	stg    %r4,144(%r2)         /* Set __flags to 0.  */
+#endif
 	std    %f8,80(%r2)
 	std    %f9,88(%r2)
 	std    %f10,96(%r2)
diff --git a/sysdeps/s390/setjmp.S b/sysdeps/s390/setjmp.S
new file mode 100644
index 0000000..2ec621a
--- /dev/null
+++ b/sysdeps/s390/setjmp.S
@@ -0,0 +1,64 @@
+/* Extendible version of setjmp for System z
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <libc-symbols.h>
+#include <shlib-compat.h>
+
+versioned_symbol (libc, __v2setjmp, setjmp, GLIBC_2_19)
+versioned_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19)
+versioned_symbol (libc, __v2__setjmp, __setjmp, GLIBC_2_19)
+versioned_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19)
+#define setjmp __v2setjmp
+#define _setjmp __v2_setjmp
+#define __setjmp __v2__setjmp
+#define __sigsetjmp __v2__sigsetjmp
+#define __sigjmp_save __v2__sigjmp_save
+
+#include "setjmp-common.S"
+
+#undef setjmp
+#undef _setjmp
+#undef __setjmp
+#undef __sigsetjmp
+#undef __sigjmp_save
+libc_hidden_ver (__v2setjmp, setjmp)
+libc_hidden_ver (__v2_setjmp, _setjmp)
+libc_hidden_ver (__v2__setjmp, __setjmp)
+libc_hidden_ver (__v2__sigsetjmp, __sigsetjmp)
+
+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19)
+compat_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0)
+compat_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0)
+compat_symbol (libc, __v1__setjmp, __setjmp, GLIBC_2_0)
+compat_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0)
+# define setjmp __v1setjmp
+# define _setjmp __v1_setjmp
+# define __setjmp __v1__setjmp
+# define __sigsetjmp __v1__sigsetjmp
+# define __sigjmp_save __v1__sigjmp_save
+# define __V1_JMPBUF
+
+# include "setjmp-common.S"
+
+# undef setjmp
+# undef _setjmp
+# undef __setjmp
+# undef __sigsetjmp
+# undef __sigjmp_save
+
+#endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) */
diff --git a/sysdeps/s390/bits/setjmp.h b/sysdeps/s390/sigjmp.c
similarity index 53%
copy from sysdeps/s390/bits/setjmp.h
copy to sysdeps/s390/sigjmp.c
index 0071a9d..f7b5a6f 100644
--- a/sysdeps/s390/bits/setjmp.h
+++ b/sysdeps/s390/sigjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -15,33 +15,20 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-/* Define the machine-dependent type `jmp_buf'.  IBM s390 version.  */
+#include <stddef.h>
+#include <setjmp.h>
+#include <signal.h>
 
-#ifndef __S390_SETJMP_H__
-#define __S390_SETJMP_H__
+/* This function is called by the `sigsetjmp' macro
+   before doing a `__setjmp' on ENV[0].__jmpbuf.
+   Always return zero.  */
 
-#if !defined _SETJMP_H && !defined _PTHREAD_H
-# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
-#endif
-
-#include <bits/wordsize.h>
-
-#ifndef	_ASM
-
-typedef struct __s390_jmp_buf
+int
+__v2__sigjmp_save (sigjmp_buf env, int savemask)
 {
-  /* We save registers 6-15.  */
-  long int __gregs[10];
-
-# if __WORDSIZE == 64
-  /* We save fpu registers f8 - f15.  */
-  long __fpregs[8];
-# else
-  /* We save fpu registers 4 and 6.  */
-  long __fpregs[4];
-# endif
-} __jmp_buf[1];
-
-#endif
+  env[0].__mask_was_saved = (savemask &&
+			     __sigprocmask (SIG_BLOCK, (sigset_t *) NULL,
+					    &env[0].__saved_mask) == 0);
 
-#endif /* __S390_SETJMP_H__ */
+  return 0;
+}
diff --git a/sysdeps/s390/v1-longjmp.c b/sysdeps/s390/v1-longjmp.c
new file mode 100644
index 0000000..82252c9
--- /dev/null
+++ b/sysdeps/s390/v1-longjmp.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.
+
+   Versioned copy of sysdeps/generic/longjmp.c modified for extended
+   jmpbuf.  */
+
+#include <shlib-compat.h>
+#include <stddef.h>
+#include <signal.h>
+#include "v1-setjmp.h"
+
+#if !defined NOT_INT_libc && defined SHARED
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19)
+
+void
+__v1__libc_siglongjmp (__v1__sigjmp_buf env, int val)
+{
+  /* Perform any cleanups needed by the frames being unwound.  */
+  _longjmp_unwind (env, val);
+
+  if (env[0].__mask_was_saved)
+    /* Restore the saved signal mask.  */
+    (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
+			  (sigset_t *) NULL);
+
+  /* Call the machine-dependent function to restore machine state.  */
+  __v1__longjmp (env[0].__jmpbuf, val ?: 1);
+}
+
+#  ifndef __v1__longjmp
+strong_alias (__v1__libc_siglongjmp, __v1__libc_longjmp)
+libc_hidden_def (__v1__libc_longjmp)
+weak_alias (__v1__libc_siglongjmp, __v1_longjmp)
+weak_alias (__v1__libc_siglongjmp, __v1longjmp)
+weak_alias (__v1__libc_siglongjmp, __v1siglongjmp)
+
+compat_symbol (libc, __v1_longjmp, _longjmp, GLIBC_2_0);
+compat_symbol (libc, __v1longjmp, longjmp, GLIBC_2_0);
+compat_symbol (libc, __v1siglongjmp, siglongjmp, GLIBC_2_0);
+
+#  endif /* ifndef __v1__longjmp */
+# endif /* SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) */
+#endif /* if !defined NOT_INT_libc && defined SHARED */
diff --git a/sysdeps/s390/v1-setjmp.h b/sysdeps/s390/v1-setjmp.h
new file mode 100644
index 0000000..a4a6b76
--- /dev/null
+++ b/sysdeps/s390/v1-setjmp.h
@@ -0,0 +1,111 @@
+/* Copyright (C) 1991-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/*
+ *	ISO C99 Standard: 7.13 Nonlocal jumps	<setjmp.h>
+ */
+
+#ifndef	_V1_SETJMP_H
+#define	_V1_SETJMP_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#define __V1_JMPBUF
+#define _SETJMP_H
+#include <bits/setjmp.h>		/* Get `__jmp_buf'.  */
+
+#ifndef _ASM
+
+#include <bits/sigset.h>		/* Get `__sigset_t'.  */
+
+
+/* Calling environment, plus possibly a saved signal mask.  */
+typedef struct __v1__jmp_buf_tag
+  {
+    /* NOTE: The machine-dependent definitions of `__sigsetjmp'
+       assume that a `jmp_buf' begins with a `__jmp_buf' and that
+       `__mask_was_saved' follows it.  Do not move these members
+       or add others before it.  */
+    __jmp_buf __jmpbuf;		/* Calling environment.  */
+    int __mask_was_saved;	/* Saved the signal mask?  */
+    __sigset_t __saved_mask;	/* Saved signal mask.  */
+  } __v1__jmp_buf[1];
+
+
+/* Store the calling environment in ENV, also saving the signal mask.
+   Return 0.  */
+extern int __v1setjmp (__v1__jmp_buf __env);
+
+/* Store the calling environment in ENV, also saving the
+   signal mask if SAVEMASK is nonzero.  Return 0.
+   This is the internal name for `sigsetjmp'.  */
+extern int __v1__sigsetjmp (struct __v1__jmp_buf_tag __env[1],
+			       int __savemask);
+
+/* Store the calling environment in ENV, not saving the signal mask.
+   Return 0.  */
+extern int __v1_setjmp (struct __v1__jmp_buf_tag __env[1]);
+
+/* Jump to the environment saved in ENV, making the
+   `setjmp' call there return VAL, or 1 if VAL is 0.  */
+extern void __v1longjmp (struct __v1__jmp_buf_tag __env[1], int __val)
+     __attribute__ ((__noreturn__));
+
+/* Same.  Usually `_longjmp' is used with `_setjmp', which does not save
+   the signal mask.  But it is how ENV was saved that determines whether
+   `longjmp' restores the mask; `_longjmp' is just an alias.  */
+extern void __v1_longjmp (struct __v1__jmp_buf_tag __env[1], int __val)
+     __attribute__ ((__noreturn__));
+
+/* Use the same type for `jmp_buf' and `sigjmp_buf'.
+   The `__mask_was_saved' flag determines whether
+   or not `longjmp' will restore the signal mask.  */
+typedef struct __v1__jmp_buf_tag __v1__sigjmp_buf[1];
+
+/* Jump to the environment saved in ENV, making the
+   sigsetjmp call there return VAL, or 1 if VAL is 0.
+   Restore the signal mask if that sigsetjmp call saved it.
+   This is just an alias `longjmp'.  */
+extern void __v1siglongjmp (__v1__sigjmp_buf __env, int __val)
+     __attribute__ ((__noreturn__));
+
+/* Internal machine-dependent function to restore context sans signal mask.  */
+extern void __v1__longjmp (__jmp_buf __env, int __val)
+     __attribute__ ((__noreturn__));
+
+/* Internal function to possibly save the current mask of blocked signals
+   in ENV, and always set the flag saying whether or not it was saved.
+   This is used by the machine-dependent definition of `__sigsetjmp'.
+   Always returns zero, for convenience.  */
+extern int __v1__sigjmp_save (__v1__jmp_buf __env, int __savemask);
+
+extern void _longjmp_unwind (__v1__jmp_buf env, int val);
+
+extern void __v1__libc_siglongjmp (__v1__sigjmp_buf env, int val)
+          __attribute__ ((noreturn));
+
+extern void __v1__libc_longjmp (__v1__sigjmp_buf env, int val)
+     __attribute__ ((noreturn));
+
+libc_hidden_proto (__v1__libc_longjmp)
+libc_hidden_proto (__v1_setjmp)
+libc_hidden_proto (__v1__sigsetjmp)
+#endif /* !_ASM */
+
+#endif /* ifndef _V1_SETJMP_H */
diff --git a/sysdeps/s390/v1-sigjmp.c b/sysdeps/s390/v1-sigjmp.c
new file mode 100644
index 0000000..b624d16
--- /dev/null
+++ b/sysdeps/s390/v1-sigjmp.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 1992-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.
+
+   Copied from setjmp/sigjmp.c for extending jmp_buf.  */
+
+#include <bits/wordsize.h>
+#include <shlib-compat.h>
+
+#if !defined NOT_IN_libc && defined SHARED
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19)
+#  include <stddef.h>
+#  include <v1-setjmp.h>
+#  include <signal.h>
+
+/* This function is called by the `sigsetjmp' macro
+   before doing a `__setjmp' on ENV[0].__jmpbuf.
+   Always return zero.  */
+
+int
+__v1__sigjmp_save (__v1__sigjmp_buf env, int savemask)
+{
+  env[0].__mask_was_saved = (savemask &&
+			     __sigprocmask (SIG_BLOCK, (sigset_t *) NULL,
+					    &env[0].__saved_mask) == 0);
+
+  return 0;
+}
+
+# endif /* SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) */
+#endif /* !NOT_IN_libc && SHARED  */
diff --git a/sysdeps/unix/sysv/linux/s390/Makefile b/sysdeps/unix/sysv/linux/s390/Makefile
index 45b1922..f91179d 100644
--- a/sysdeps/unix/sysv/linux/s390/Makefile
+++ b/sysdeps/unix/sysv/linux/s390/Makefile
@@ -16,3 +16,9 @@ endif
 ifeq ($(subdir),elf)
 sysdep_routines += dl-vdso
 endif
+
+ifeq ($(subdir),debug)
+ifeq (yes,$(build-shared))
+sysdep_routines += v1-longjmp_chk
+endif
+endif
diff --git a/sysdeps/unix/sysv/linux/s390/Versions b/sysdeps/unix/sysv/linux/s390/Versions
index 627ff53..9577823 100644
--- a/sysdeps/unix/sysv/linux/s390/Versions
+++ b/sysdeps/unix/sysv/linux/s390/Versions
@@ -1,4 +1,7 @@
 libc {
+  GLIBC_2.19 {
+    __longjmp_chk;
+  }
   GLIBC_PRIVATE {
     __vdso_clock_gettime;
     __vdso_clock_getres;
diff --git a/sysdeps/s390/bits/setjmp.h b/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
similarity index 50%
copy from sysdeps/s390/bits/setjmp.h
copy to sysdeps/unix/sysv/linux/s390/longjmp_chk.c
index 0071a9d..10f542d 100644
--- a/sysdeps/s390/bits/setjmp.h
+++ b/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,35 +13,32 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <http://www.gnu.org/licenses/>.
 
-/* Define the machine-dependent type `jmp_buf'.  IBM s390 version.  */
+   This is a copy of debug/longjmp_chk.c extended for symbol
+   versioning.  */
 
-#ifndef __S390_SETJMP_H__
-#define __S390_SETJMP_H__
+#include <shlib-compat.h>
+#include <setjmp.h>
 
-#if !defined _SETJMP_H && !defined _PTHREAD_H
-# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
-#endif
+/* This place is the only user of these functions.  */
+extern void ____v2__longjmp_chk (__jmp_buf __env, int __val)
+     __attribute__ ((__noreturn__));
 
-#include <bits/wordsize.h>
+#if defined NOT_IN_libc
 
-#ifndef	_ASM
+# define __v2__longjmp ____longjmp_chk
+# define __v2__libc_siglongjmp __longjmp_chk
 
-typedef struct __s390_jmp_buf
-{
-  /* We save registers 6-15.  */
-  long int __gregs[10];
+# include <longjmp.c>
 
-# if __WORDSIZE == 64
-  /* We save fpu registers f8 - f15.  */
-  long __fpregs[8];
-# else
-  /* We save fpu registers 4 and 6.  */
-  long __fpregs[4];
-# endif
-} __jmp_buf[1];
+#else
 
-#endif
+# define __v2__longjmp ____v2__longjmp_chk
+# define __v2__libc_siglongjmp __v2__libc_siglongjmp_chk
+
+# include <longjmp.c>
 
-#endif /* __S390_SETJMP_H__ */
+versioned_symbol (libc, __v2__libc_siglongjmp_chk, __longjmp_chk, GLIBC_2_19);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
index e74f335..a1b7a6a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c
@@ -26,8 +26,8 @@
 #include <stdint.h>
 #include <signal.h>
 #include <sys/syscall.h>
-
-#define __longjmp ____longjmp_chk
+#include <libc-symbols.h>
+#include <shlib-compat.h>
 
 #define CHECK_SP(env, guard) \
   do									\
@@ -51,4 +51,22 @@
 	}								\
     } while (0)
 
-#include "__longjmp.c"
+
+#if defined NOT_IN_libc
+/* Build a non-versioned object for rtld-*.  */
+# define __longjmp ____longjmp_chk
+# include "__longjmp-common.c"
+
+#else /* !NOT_IN_libc */
+# define __longjmp  ____v2__longjmp_chk
+# include "__longjmp-common.c"
+
+# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_11, GLIBC_2_19)
+#  undef __longjmp
+#  define __V1_JMPBUF
+#  define __longjmp  ____v1__longjmp_chk
+#  include "__longjmp-common.c"
+#  undef __longjmp
+
+# endif
+#endif /* !NOT_IN_libc */
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
index b6256d5..18ec994 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
@@ -1774,6 +1774,16 @@ GLIBC_2.17
 GLIBC_2.18
  GLIBC_2.18 A
  __cxa_thread_atexit_impl F
+GLIBC_2.19
+ GLIBC_2.19 A
+ __longjmp_chk F
+ __setjmp F
+ __sigsetjmp F
+ _longjmp F
+ _setjmp F
+ longjmp F
+ setjmp F
+ siglongjmp F
 GLIBC_2.2
  GLIBC_2.2 A
  _IO_adjust_wcolumn F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libpthread.abilist
index 865364e..699de01 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libpthread.abilist
@@ -178,6 +178,10 @@ GLIBC_2.18
  GLIBC_2.18 A
  pthread_getattr_default_np F
  pthread_setattr_default_np F
+GLIBC_2.19
+ GLIBC_2.19 A
+ longjmp F
+ siglongjmp F
 GLIBC_2.2
  GLIBC_2.2 A
  __open64 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
index a3b1375..bc27b08 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c
@@ -26,8 +26,8 @@
 #include <stdint.h>
 #include <signal.h>
 #include <sys/syscall.h>
-
-#define __longjmp ____longjmp_chk
+#include <libc-symbols.h>
+#include <shlib-compat.h>
 
 #define CHECK_SP(env, guard) \
   do									\
@@ -51,4 +51,23 @@
 	}								\
     } while (0)
 
-#include "__longjmp.c"
+
+#if defined NOT_IN_libc
+/* Build a non-versioned object for rtld-*.  */
+# define __longjmp ____longjmp_chk
+# include "__longjmp-common.c"
+
+#else /* !NOT_IN_libc */
+# define __longjmp  ____v2__longjmp_chk
+# include "__longjmp-common.c"
+# undef __longjmp
+
+# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_11, GLIBC_2_19)
+#  undef __longjmp
+#  define __V1_JMPBUF
+#  define __longjmp  ____v1__longjmp_chk
+#  include "__longjmp-common.c"
+#  undef __longjmp
+
+# endif
+#endif /* !NOT_IN_libc */
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
index 265f66d..05b5286 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
@@ -95,6 +95,16 @@ GLIBC_2.17
 GLIBC_2.18
  GLIBC_2.18 A
  __cxa_thread_atexit_impl F
+GLIBC_2.19
+ GLIBC_2.19 A
+ __longjmp_chk F
+ __setjmp F
+ __sigsetjmp F
+ _longjmp F
+ _setjmp F
+ longjmp F
+ setjmp F
+ siglongjmp F
 GLIBC_2.2
  GLIBC_2.2 A
  _Exit F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libpthread.abilist
index 6613c09..51a8a7f 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libpthread.abilist
@@ -12,6 +12,10 @@ GLIBC_2.18
  GLIBC_2.18 A
  pthread_getattr_default_np F
  pthread_setattr_default_np F
+GLIBC_2.19
+ GLIBC_2.19 A
+ longjmp F
+ siglongjmp F
 GLIBC_2.2
  GLIBC_2.2 A
  _IO_flockfile F
diff --git a/sysdeps/s390/bits/setjmp.h b/sysdeps/unix/sysv/linux/s390/v1-longjmp_chk.c
similarity index 51%
copy from sysdeps/s390/bits/setjmp.h
copy to sysdeps/unix/sysv/linux/s390/v1-longjmp_chk.c
index 0071a9d..bd80acf 100644
--- a/sysdeps/s390/bits/setjmp.h
+++ b/sysdeps/unix/sysv/linux/s390/v1-longjmp_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,35 +13,23 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <http://www.gnu.org/licenses/>.
 
-/* Define the machine-dependent type `jmp_buf'.  IBM s390 version.  */
+   This went into a separate source file since we would otherwise be
+   needed to include two different versions of setjmp.h into the same
+   file.  */
 
-#ifndef __S390_SETJMP_H__
-#define __S390_SETJMP_H__
+#include <shlib-compat.h>
 
-#if !defined _SETJMP_H && !defined _PTHREAD_H
-# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
-#endif
+#if !defined NOT_IN_libc && defined SHARED
+# if SHLIB_COMPAT (libc, GLIBC_2_11, GLIBC_2_19)
 
-#include <bits/wordsize.h>
+#  define __v1__longjmp ____v1__longjmp_chk
+#  define __v1__libc_siglongjmp __v1__libc_siglongjmp_chk
 
-#ifndef	_ASM
+#  include <v1-longjmp.c>
 
-typedef struct __s390_jmp_buf
-{
-  /* We save registers 6-15.  */
-  long int __gregs[10];
+compat_symbol (libc, __v1__libc_siglongjmp_chk, __longjmp_chk, GLIBC_2_11);
 
-# if __WORDSIZE == 64
-  /* We save fpu registers f8 - f15.  */
-  long __fpregs[8];
-# else
-  /* We save fpu registers 4 and 6.  */
-  long __fpregs[4];
 # endif
-} __jmp_buf[1];
-
 #endif
-
-#endif /* __S390_SETJMP_H__ */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   92 ++++++++++++++++
 Versions.def                                       |    1 +
 nptl/sysdeps/unix/sysv/linux/s390/Versions         |    5 +
 nptl/sysdeps/unix/sysv/linux/s390/pt-longjmp.c     |   63 +++++++++++
 sysdeps/s390/Makefile                              |    9 ++
 sysdeps/s390/Versions                              |   11 ++
 sysdeps/s390/__longjmp.c                           |   31 ++++++
 sysdeps/s390/bits/setjmp.h                         |    4 +
 sysdeps/s390/dl-tls.h                              |    2 +-
 sysdeps/s390/longjmp.c                             |   64 +++++++++++
 sysdeps/s390/rtld-__longjmp.c                      |   19 ++++
 .../arm => sysdeps/s390}/rtld-global-offsets.sym   |    0
 sysdeps/s390/rtld-setjmp.S                         |   20 ++++
 sysdeps/s390/s390-32/__longjmp-common.c            |   68 ++++++++++++
 sysdeps/s390/s390-32/__longjmp.c                   |   68 ------------
 sysdeps/s390/s390-32/dl-machine.h                  |    3 +-
 sysdeps/s390/s390-32/setjmp-common.S               |   84 +++++++++++++++
 sysdeps/s390/s390-32/setjmp.S                      |   80 --------------
 sysdeps/s390/s390-64/__longjmp-common.c            |   74 +++++++++++++
 sysdeps/s390/s390-64/__longjmp.c                   |   74 -------------
 sysdeps/s390/s390-64/setjmp-common.S               |   79 ++++++++++++++
 sysdeps/s390/s390-64/setjmp.S                      |   75 -------------
 sysdeps/s390/setjmp.S                              |   64 +++++++++++
 sysdeps/s390/sigjmp.c                              |   34 ++++++
 sysdeps/s390/v1-longjmp.c                          |   57 ++++++++++
 sysdeps/s390/v1-setjmp.h                           |  111 +++++++++++++++++++
 sysdeps/s390/v1-sigjmp.c                           |   44 ++++++++
 sysdeps/unix/sysv/linux/s390/Makefile              |    6 +
 sysdeps/unix/sysv/linux/s390/Versions              |    4 +
 sysdeps/unix/sysv/linux/s390/getcontext.S          |   38 +++++++
 sysdeps/unix/sysv/linux/s390/longjmp_chk.c         |   44 ++++++++
 sysdeps/unix/sysv/linux/s390/rtld-getcontext.S     |   19 ++++
 .../unix/sysv/linux/s390/s390-32/____longjmp_chk.c |   24 ++++-
 .../sysv/linux/s390/s390-32/getcontext-common.S    |  112 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S  |   75 -------------
 .../unix/sysv/linux/s390/s390-32/nptl/libc.abilist |   11 ++
 .../linux/s390/s390-32/nptl/libpthread.abilist     |    4 +
 sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S  |   12 ++-
 sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S |   27 ++++-
 .../unix/sysv/linux/s390/s390-32/sys/ucontext.h    |   96 +++++++++++++++++
 .../unix/sysv/linux/s390/s390-32/ucontext_i.sym    |   26 +++++
 .../unix/sysv/linux/s390/s390-64/____longjmp_chk.c |   25 ++++-
 .../sysv/linux/s390/s390-64/getcontext-common.S    |   79 ++++++++++++++
 sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S  |   75 -------------
 .../unix/sysv/linux/s390/s390-64/nptl/libc.abilist |   11 ++
 .../linux/s390/s390-64/nptl/libpthread.abilist     |    4 +
 sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S |   19 +++-
 .../unix/sysv/linux/s390/s390-64/sys/ucontext.h    |   96 +++++++++++++++++
 .../sysv/linux/s390/{ => s390-64}/ucontext_i.sym   |    0
 sysdeps/unix/sysv/linux/s390/sys/ucontext.h        |   87 ---------------
 sysdeps/unix/sysv/linux/s390/v1-longjmp_chk.c      |   35 ++++++
 51 files changed, 1609 insertions(+), 556 deletions(-)
 create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/Versions
 create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
 create mode 100644 sysdeps/s390/Makefile
 create mode 100644 sysdeps/s390/__longjmp.c
 create mode 100644 sysdeps/s390/longjmp.c
 create mode 100644 sysdeps/s390/rtld-__longjmp.c
 copy {ports/sysdeps/arm => sysdeps/s390}/rtld-global-offsets.sym (100%)
 create mode 100644 sysdeps/s390/rtld-setjmp.S
 create mode 100644 sysdeps/s390/s390-32/__longjmp-common.c
 delete mode 100644 sysdeps/s390/s390-32/__longjmp.c
 create mode 100644 sysdeps/s390/s390-32/setjmp-common.S
 delete mode 100644 sysdeps/s390/s390-32/setjmp.S
 create mode 100644 sysdeps/s390/s390-64/__longjmp-common.c
 delete mode 100644 sysdeps/s390/s390-64/__longjmp.c
 create mode 100644 sysdeps/s390/s390-64/setjmp-common.S
 delete mode 100644 sysdeps/s390/s390-64/setjmp.S
 create mode 100644 sysdeps/s390/setjmp.S
 create mode 100644 sysdeps/s390/sigjmp.c
 create mode 100644 sysdeps/s390/v1-longjmp.c
 create mode 100644 sysdeps/s390/v1-setjmp.h
 create mode 100644 sysdeps/s390/v1-sigjmp.c
 create mode 100644 sysdeps/unix/sysv/linux/s390/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/s390/longjmp_chk.c
 create mode 100644 sysdeps/unix/sysv/linux/s390/rtld-getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getcontext-common.S
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h
 rename sysdeps/unix/sysv/linux/s390/{ => s390-64}/ucontext_i.sym (100%)
 delete mode 100644 sysdeps/unix/sysv/linux/s390/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/v1-longjmp_chk.c


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]