]> sourceware.org Git - glibc.git/commitdiff
Align TCB offset to the maximum alignment
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 7 May 2015 20:26:34 +0000 (13:26 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 24 Jun 2015 23:30:58 +0000 (16:30 -0700)
We need to align TCB offset to the maximum alignment for TLS_TCB_AT_TP
targets, as _dl_allocate_tls_storage (in elf/dl-tls.c) does using
__libc_memalign and dl_tls_static_align.

[BZ #18383]
* csu/libc-tls.c (__libc_setup_tls) [TLS_TCB_AT_TP]: Align
TCB_OFFSET to MAX_ALIGN, not just TCBALIGN.  Add comment.
* elf/Makefile (test-xfail-tst-tlsalign{,-static}): Remove
comment for i386/x86-64.
(test-xfail-tst-tlsalign-extern-static): Removed.

ChangeLog
csu/libc-tls.c
elf/Makefile

index 97fbe48627b5d99896e1d05e4f01fc85526f1e1b..eb44829cd8853c119bba754102974664314d301d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-06-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #18383]
+       * csu/libc-tls.c (__libc_setup_tls) [TLS_TCB_AT_TP]: Align
+       TCB_OFFSET to MAX_ALIGN, not just TCBALIGN.  Add comment.
+       * elf/Makefile (test-xfail-tst-tlsalign{,-static}): Remove
+       comment for i386/x86-64.
+       (test-xfail-tst-tlsalign-extern-static): Removed.
+
 2015-06-24  Joseph Myers  <joseph@codesourcery.com>
 
        * math/test-double.h: New file.
index 64d177955feb2ad083c1a2bc3265efaadd58cc07..3f134252a34ba2887041cbf87dbdacc0d9d542b0 100644 (file)
@@ -138,7 +138,10 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
      to request some surplus that permits dynamic loading of modules with
      IE-model TLS.  */
 #if TLS_TCB_AT_TP
-  tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
+  /* Align the TCB offset to the maximum alignment, as
+     _dl_allocate_tls_storage (in elf/dl-tls.c) does using __libc_memalign
+     and dl_tls_static_align.  */
+  tcb_offset = roundup (memsz + GL(dl_tls_static_size), max_align);
   tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
 #elif TLS_DTV_AT_TP
   tcb_offset = roundup (tcbsize, align ?: 1);
index 871cb4fd65b1611ed4833182c8525916e6da5f67..4ea3ccf4410483cafa4b50e40ca537310ee4d0df 100644 (file)
@@ -523,16 +523,13 @@ $(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so
 $(objpfx)tst-null-argv: $(objpfx)tst-null-argv-lib.so
 $(objpfx)tst-tlsalign: $(objpfx)tst-tlsalign-lib.so
 
-# BZ#18383: broken on at least ARM (both) and i386/x86-64 (static only).
+# BZ#18383: broken on at least ARM (both).
 test-xfail-tst-tlsalign = yes
 test-xfail-tst-tlsalign-static = yes
 
 $(objpfx)tst-tlsalign-extern: $(objpfx)tst-tlsalign-vars.o
 $(objpfx)tst-tlsalign-extern-static: $(objpfx)tst-tlsalign-vars.o
 
-# BZ#18383: broken on at least i386/x86-64 (static only).
-test-xfail-tst-tlsalign-extern-static = yes
-
 tst-null-argv-ENV = LD_DEBUG=all LD_DEBUG_OUTPUT=$(objpfx)tst-null-argv.debug.out
 LDFLAGS-nodel2mod3.so = $(no-as-needed)
 LDFLAGS-reldepmod5.so = $(no-as-needed)
This page took 0.130913 seconds and 5 git commands to generate.