This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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]

[PATCH 5/6] Cygwin: cygtls: move local_clib member to start of class


From: Corinna Vinschen <corinna@vinschen.de>

So local_clib has a constant address offset in TLS so we can
expose the address into userspace.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
---
 winsup/cygwin/cygtls.h       |  6 ++++--
 winsup/cygwin/tlsoffsets.h   | 24 ++++++++++++------------
 winsup/cygwin/tlsoffsets64.h | 24 ++++++++++++------------
 3 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/winsup/cygwin/cygtls.h b/winsup/cygwin/cygtls.h
index 18d9378f88ec..70bd36e4401d 100644
--- a/winsup/cygwin/cygtls.h
+++ b/winsup/cygwin/cygtls.h
@@ -170,13 +170,15 @@ typedef uintptr_t __tlsstack_t;
 class _cygtls
 {
 public:
-  /* Please keep these two declarations first */
-  struct _local_storage locals;
+  /* Please keep these two declarations first, especially the union must
+     remain at the start of this class.  Its position is referenced from
+     userspace. */
   union
   {
     struct _reent local_clib;
     char __dontuse[8 * ((sizeof(struct _reent) + 4) / 8)];
   };
+  struct _local_storage locals;
   /**/
   void (*func) /*gentls_offsets*/(int, siginfo_t *, void *)/*gentls_offsets*/;
   int saved_errno;
diff --git a/winsup/cygwin/tlsoffsets.h b/winsup/cygwin/tlsoffsets.h
index 13d1003e334f..2513a055a3af 100644
--- a/winsup/cygwin/tlsoffsets.h
+++ b/winsup/cygwin/tlsoffsets.h
@@ -1,12 +1,12 @@
 //;# autogenerated:  Do not edit.
 
 //; $tls::start_offset = -12700;
-//; $tls::locals = -12700;
-//; $tls::plocals = 0;
-//; $tls::local_clib = -10980;
-//; $tls::plocal_clib = 1720;
-//; $tls::__dontuse = -10980;
-//; $tls::p__dontuse = 1720;
+//; $tls::local_clib = -12700;
+//; $tls::plocal_clib = 0;
+//; $tls::__dontuse = -12700;
+//; $tls::p__dontuse = 0;
+//; $tls::locals = -11612;
+//; $tls::plocals = 1088;
 //; $tls::func = -9892;
 //; $tls::pfunc = 2808;
 //; $tls::saved_errno = -9888;
@@ -63,12 +63,12 @@
 //; $tls::pinitialized = 4852;
 //; __DATA__
 
-#define tls_locals (-12700)
-#define tls_plocals (0)
-#define tls_local_clib (-10980)
-#define tls_plocal_clib (1720)
-#define tls___dontuse (-10980)
-#define tls_p__dontuse (1720)
+#define tls_local_clib (-12700)
+#define tls_plocal_clib (0)
+#define tls___dontuse (-12700)
+#define tls_p__dontuse (0)
+#define tls_locals (-11612)
+#define tls_plocals (1088)
 #define tls_func (-9892)
 #define tls_pfunc (2808)
 #define tls_saved_errno (-9888)
diff --git a/winsup/cygwin/tlsoffsets64.h b/winsup/cygwin/tlsoffsets64.h
index d137408d0e0c..9388cadd8e2c 100644
--- a/winsup/cygwin/tlsoffsets64.h
+++ b/winsup/cygwin/tlsoffsets64.h
@@ -1,12 +1,12 @@
 //;# autogenerated:  Do not edit.
 
 //; $tls::start_offset = -12800;
-//; $tls::locals = -12800;
-//; $tls::plocals = 0;
-//; $tls::local_clib = -10624;
-//; $tls::plocal_clib = 2176;
-//; $tls::__dontuse = -10624;
-//; $tls::p__dontuse = 2176;
+//; $tls::local_clib = -12800;
+//; $tls::plocal_clib = 0;
+//; $tls::__dontuse = -12800;
+//; $tls::p__dontuse = 0;
+//; $tls::locals = -10912;
+//; $tls::plocals = 1888;
 //; $tls::func = -8736;
 //; $tls::pfunc = 4064;
 //; $tls::saved_errno = -8728;
@@ -63,12 +63,12 @@
 //; $tls::pinitialized = 7768;
 //; __DATA__
 
-#define tls_locals (-12800)
-#define tls_plocals (0)
-#define tls_local_clib (-10624)
-#define tls_plocal_clib (2176)
-#define tls___dontuse (-10624)
-#define tls_p__dontuse (2176)
+#define tls_local_clib (-12800)
+#define tls_plocal_clib (0)
+#define tls___dontuse (-12800)
+#define tls_p__dontuse (0)
+#define tls_locals (-10912)
+#define tls_plocals (1888)
 #define tls_func (-8736)
 #define tls_pfunc (4064)
 #define tls_saved_errno (-8728)
-- 
2.9.5


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