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 hjl/cet/master updated. glibc-2.26.9000-955-g0378cba


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, hjl/cet/master has been updated
       via  0378cba2fd2801130a569834aae9f29aa0197a1e (commit)
       via  2e3e5323b69b07d460349515fa4c0c66356e3648 (commit)
      from  63f003ec3d687be1425f859e44104719b3df6b5e (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=0378cba2fd2801130a569834aae9f29aa0197a1e

commit 0378cba2fd2801130a569834aae9f29aa0197a1e
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Dec 6 21:15:45 2017 -0800

    x86-64: Add IFUNC setjmp.c

diff --git a/sysdeps/unix/sysv/linux/x86/Makefile b/sysdeps/unix/sysv/linux/x86/Makefile
index a7c0a34..6ea7fa1 100644
--- a/sysdeps/unix/sysv/linux/x86/Makefile
+++ b/sysdeps/unix/sysv/linux/x86/Makefile
@@ -30,6 +30,10 @@ ifeq ($(subdir),elf)
 sysdep-dl-routines += dl-cet
 endif
 
+ifeq ($(subdir),setjmp)
+sysdep_routines += setjmp-compat setjmp-shstk
+endif
+
 # Add -fcf-protection -mcet to CFLAGS when CET is enabled.
 CFLAGS-.o += -fcf-protection -mcet
 CFLAGS-.os += -fcf-protection -mcet
diff --git a/sysdeps/unix/sysv/linux/x86/ifunc-setjmp.h b/sysdeps/unix/sysv/linux/x86/ifunc-setjmp.h
new file mode 100644
index 0000000..5a329cf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/ifunc-setjmp.h
@@ -0,0 +1,33 @@
+/* Common definition for setjmp/longjmp ifunc selections.
+   Copyright (C) 2017 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 <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (compat) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (shstk) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+  const struct cpu_features* cpu_features = __get_cpu_features ();
+
+  if (CPU_FEATURES_ARCH_P (cpu_features, SHSTK_Enabled))
+    return OPTIMIZE (shstk);
+
+  return OPTIMIZE (compat);
+}
diff --git a/sysdeps/unix/sysv/linux/x86/setjmp.c b/sysdeps/unix/sysv/linux/x86/setjmp.c
new file mode 100644
index 0000000..5aa1217
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/setjmp.c
@@ -0,0 +1,30 @@
+/* Multiple versions of setjmp.
+   Copyright (C) 2017 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/>.  */
+
+/* Define multiple versions only for the definition in libc.so  */
+#if IS_IN (libc) && defined SHARED
+# define __sigsetjmp __redirect___sigsetjmp
+# include <setjmp.h>
+# undef __sigsetjmp
+
+# define SYMBOL_NAME __sigsetjmp
+# include "ifunc-setjmp.h"
+
+libc_ifunc_redirected (__redirect___sigsetjmp, __sigsetjmp,
+		       IFUNC_SELECTOR ());
+#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/rtld-setjmp.S b/sysdeps/unix/sysv/linux/x86_64/rtld-setjmp.S
new file mode 100644
index 0000000..eec0bda
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/rtld-setjmp.S
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/x86_64/setjmp-shstk.S>
diff --git a/sysdeps/unix/sysv/linux/x86_64/setjmp-compat.S b/sysdeps/unix/sysv/linux/x86_64/setjmp-compat.S
new file mode 100644
index 0000000..c52217b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/setjmp-compat.S
@@ -0,0 +1,4 @@
+#if IS_IN (libc) && defined SHARED
+# define __sigsetjmp ____sigsetjmp_compat
+# include <sysdeps/x86_64/setjmp.S>
+#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/setjmp.S b/sysdeps/unix/sysv/linux/x86_64/setjmp-shstk.S
similarity index 91%
rename from sysdeps/unix/sysv/linux/x86_64/setjmp.S
rename to sysdeps/unix/sysv/linux/x86_64/setjmp-shstk.S
index 5f97a98..46939e5 100644
--- a/sysdeps/unix/sysv/linux/x86_64/setjmp.S
+++ b/sysdeps/unix/sysv/linux/x86_64/setjmp-shstk.S
@@ -23,6 +23,10 @@
 #include <stap-probe.h>
 #include <jmp_buf-ssp.h>
 
+#if IS_IN (libc) && defined SHARED
+# define __sigsetjmp ____sigsetjmp_shstk
+#endif
+
 ENTRY (__sigsetjmp)
 	/* Save registers.  */
 	movq %rbx, (JB_RBX*8)(%rdi)
@@ -71,4 +75,10 @@ ENTRY (__sigsetjmp)
 	jmp __sigjmp_save
 #endif
 END (__sigsetjmp)
+#if IS_IN (libc) && defined SHARED
+	.hidden __GI___sigsetjmp
+	.globl	__GI___sigsetjmp
+	__GI___sigsetjmp = ____sigsetjmp_shstk
+#else
 hidden_def (__sigsetjmp)
+#endif
diff --git a/sysdeps/x86_64/setjmp.S b/sysdeps/x86_64/setjmp.S
index 3a88903..5c5dbd0 100644
--- a/sysdeps/x86_64/setjmp.S
+++ b/sysdeps/x86_64/setjmp.S
@@ -63,4 +63,6 @@ ENTRY (__sigsetjmp)
 	jmp __sigjmp_save
 #endif
 END (__sigsetjmp)
+#ifndef __sigsetjmp
 hidden_def (__sigsetjmp)
+#endif

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

commit 2e3e5323b69b07d460349515fa4c0c66356e3648
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Dec 6 21:15:09 2017 -0800

    x86: Add bit_arch_SHSTK_Enabled

diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
index 187a8a5..26ba036 100644
--- a/sysdeps/x86/cpu-features.h
+++ b/sysdeps/x86/cpu-features.h
@@ -40,6 +40,7 @@
 #define bit_arch_Prefer_No_AVX512		(1 << 20)
 #define bit_arch_MathVec_Prefer_No_AVX512	(1 << 21)
 #define bit_arch_XSAVEC_Usable			(1 << 22)
+#define bit_arch_SHSTK_Enabled			(1 << 23)
 
 /* CPUID Feature flags.  */
 
@@ -266,6 +267,7 @@ extern void _dl_setup_cet (const ElfW(Phdr) *, size_t, const ElfW(Addr))
 # define index_arch_Prefer_No_AVX512	FEATURE_INDEX_1
 # define index_arch_MathVec_Prefer_No_AVX512 FEATURE_INDEX_1
 # define index_arch_XSAVEC_Usable	FEATURE_INDEX_1
+# define index_arch_SHSTK_Enabled	FEATURE_INDEX_1
 
 #endif	/* !__ASSEMBLER__ */
 
diff --git a/sysdeps/x86/cpu-tunables.c b/sysdeps/x86/cpu-tunables.c
index dcd0165..bd28c9d 100644
--- a/sysdeps/x86/cpu-tunables.c
+++ b/sysdeps/x86/cpu-tunables.c
@@ -250,6 +250,8 @@ TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *valp)
 		= cpu_features->xsave_state_full_size;
 	      CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features,
 					  XSAVEC_Usable, 13);
+	      CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features,
+					  SHSTK_Enabled, 13);
 	    }
 	  break;
 	case 14:

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

Summary of changes:
 sysdeps/unix/sysv/linux/x86/Makefile           |    4 +
 sysdeps/unix/sysv/linux/x86/ifunc-setjmp.h     |   33 +++++++++
 sysdeps/unix/sysv/linux/x86/setjmp.c           |   30 +++++++++
 sysdeps/unix/sysv/linux/x86_64/rtld-setjmp.S   |    1 +
 sysdeps/unix/sysv/linux/x86_64/setjmp-compat.S |    4 +
 sysdeps/unix/sysv/linux/x86_64/setjmp-shstk.S  |   84 ++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/x86_64/setjmp.S        |   74 ---------------------
 sysdeps/x86/cpu-features.h                     |    2 +
 sysdeps/x86/cpu-tunables.c                     |    2 +
 sysdeps/x86_64/setjmp.S                        |    2 +
 10 files changed, 162 insertions(+), 74 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/x86/ifunc-setjmp.h
 create mode 100644 sysdeps/unix/sysv/linux/x86/setjmp.c
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/rtld-setjmp.S
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/setjmp-compat.S
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/setjmp-shstk.S
 delete mode 100644 sysdeps/unix/sysv/linux/x86_64/setjmp.S


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]