about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--sysdeps/i386/nptl/tls.h7
-rw-r--r--sysdeps/x86_64/nptl/tls.h10
3 files changed, 26 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c1b9cdfd29..c1ff22b191 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-06-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #23250]
+	[BZ #10686]
+	* sysdeps/i386/nptl/tls.h (tcbhead_t): Change __private_tm[4]
+	to _private_tm[3] and add __glibc_reserved2.
+	Add _Static_assert of offset of __private_ss == 0x30.
+	* sysdeps/x86_64/nptl/tls.h: Add _Static_assert of offset of
+	__private_ss == 0x40 for ILP32 and == 0x70 for LP64.
+
 2018-06-12  Florian Weimer  <fweimer@redhat.com>
 
 	x86: Make strncmp usable from rtld.
diff --git a/sysdeps/i386/nptl/tls.h b/sysdeps/i386/nptl/tls.h
index 6c36e58e9c..afb71ce431 100644
--- a/sysdeps/i386/nptl/tls.h
+++ b/sysdeps/i386/nptl/tls.h
@@ -43,11 +43,16 @@ typedef struct
   int gscope_flag;
   int __glibc_reserved1;
   /* Reservation of some values for the TM ABI.  */
-  void *__private_tm[4];
+  void *__private_tm[3];
   /* GCC split stack support.  */
   void *__private_ss;
+  void *__glibc_reserved2;
 } tcbhead_t;
 
+/* morestack.S in libgcc uses offset 0x30 to access __private_ss,   */
+_Static_assert (offsetof (tcbhead_t, __private_ss) == 0x30,
+		"offset of __private_ss != 0x30");
+
 # define TLS_MULTIPLE_THREADS_IN_TCB 1
 
 #else /* __ASSEMBLER__ */
diff --git a/sysdeps/x86_64/nptl/tls.h b/sysdeps/x86_64/nptl/tls.h
index 6da1c04a98..65c0051dcf 100644
--- a/sysdeps/x86_64/nptl/tls.h
+++ b/sysdeps/x86_64/nptl/tls.h
@@ -65,6 +65,16 @@ typedef struct
   void *__padding[8];
 } tcbhead_t;
 
+# ifdef __ILP32__
+/* morestack.S in libgcc uses offset 0x40 to access __private_ss,   */
+_Static_assert (offsetof (tcbhead_t, __private_ss) == 0x40,
+		"offset of __private_ss != 0x40");
+# else
+/* morestack.S in libgcc uses offset 0x70 to access __private_ss,   */
+_Static_assert (offsetof (tcbhead_t, __private_ss) == 0x70,
+		"offset of __private_ss != 0x70");
+# endif
+
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
 #endif