]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(_dl_determine_tlsoffset): Restore alignment of TCB used before the last change so...
authorUlrich Drepper <drepper@redhat.com>
Wed, 30 Jul 2003 05:21:00 +0000 (05:21 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 30 Jul 2003 05:21:00 +0000 (05:21 +0000)
sysdeps/generic/dl-tls.c

index ccad53c59f5c2a67bb710549ac704fca95d0661c..48d90ab8bbf8c285bf39980e06da7f8dc7431701 100644 (file)
@@ -150,13 +150,6 @@ _dl_determine_tlsoffset (void)
      assuming the first byte of the TLS block is aligned according to
      p_align.
 
-     We can handle this wrong behavior because of another bug in GNU
-     ld.  The p_vaddr field of the TLS segment must be zero (according
-     to the spec) since the linker does not know the address or offset
-     where it will end up at.  Once a linker is available which
-     handles the alignment correctly it should set p_addr to zero and
-     all will automatically fall into place.
-
      The extra space which might be allocated before the first byte of
      the TLS block need not go unused.  The code below tries to use
      that memory for the next TLS block.  This can work if the total
@@ -165,11 +158,11 @@ _dl_determine_tlsoffset (void)
 
 # if TLS_TCB_AT_TP
   /* We simply start with zero.  */
-  max_align = __alignof (void *);
+  slotinfo = GL(dl_tls_dtv_slotinfo_list)->slotinfo;
+  max_align = slotinfo[1].map != NULL ? slotinfo[1].map->l_tls_align : 1;
   offset = 0;
   freebytes = 0;
 
-  slotinfo = GL(dl_tls_dtv_slotinfo_list)->slotinfo;
   for (cnt = 1; slotinfo[cnt].map != NULL; ++cnt)
     {
       assert (cnt < GL(dl_tls_dtv_slotinfo_list)->len);