TLS fixes, mainly alignment handling
authorRich Felker <dalias@aerifal.cx>
Sat, 6 Oct 2012 05:22:51 +0000 (01:22 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 6 Oct 2012 05:22:51 +0000 (01:22 -0400)
commitcf3fd3d002c728ed0ef5d3aef856ff3e1d418da0
tree9fe4aebad93aba1704dc82220aab22efaa5538e8
parentf4f77c068f1058d202a976678fce2617d59c0ff6
TLS fixes, mainly alignment handling

compute offsets from the thread pointer statically when loading the
library, rather than repeating the logic on each thread creation. not
only is the latter less efficient at runtime; it also fails to provide
solid guarantees that the offsets will remain the same when the
initial alignment of memory is different. the new alignment handling
is both more rigorous and simpler.

the old code was also clobbering TLS bss with random image data in
some cases due to using tls_size (size of TLS segment) instead of
tls_len (length of the TLS data image).
src/ldso/dynlink.c