This is the mail archive of the libc-alpha@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]

PATCH: Add x32 support to tcbhead_t


Hi,

X32 TCB has the same layout as x86-64, except for long and pointer
are 32 bits.  We also need to pad it to align rtld_savespace_sse to
32byte since sysdeps/x86_64/dl-trampoline.S has

	vmovdqa %ymm0, %fs:RTLD_SAVESPACE_SSE+0*YMM_SIZE

Tested on Linux/x32 and Linux/x86-64.  OK to install?

Thanks.

H.J.
---
	* sysdeps/x86_64/tls.h: Don't include <bits/wordsize.h>.
	Check __x86_64__ instead of __WORDSIZE.
	(tcbhead_t): Pad rtld_savespace_sse to 32byte aligned.

diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h
index f644f0d..ed5716a 100644
--- a/nptl/sysdeps/x86_64/tls.h
+++ b/nptl/sysdeps/x86_64/tls.h
@@ -27,7 +27,6 @@
 # include <stdlib.h>
 # include <sysdep.h>
 # include <kernel-features.h>
-# include <bits/wordsize.h>
 # include <xmmintrin.h>
 
 
@@ -60,17 +59,22 @@ typedef struct
 # else
   int __unused1;
 # endif
-# if __WORDSIZE == 64
+# ifdef __x86_64__
   int rtld_must_xmm_save;
 # endif
   /* Reservation of some values for the TM ABI.  */
   void *__private_tm[5];
-# if __WORDSIZE == 64
+# ifdef __x86_64__
+#  ifdef __LP64__
   long int __unused2;
+#  else
+  /* Pad rtld_savespace_sse to 32byte aligned.  */
+  void *__padding1[5];
+#  endif
   /* Have space for the post-AVX register size.  */
   __m128 rtld_savespace_sse[8][4];
 
-  void *__padding[8];
+  void *__padding2[8];
 # endif
 } tcbhead_t;
 


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