diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-07-13 14:54:34 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-07-13 14:54:34 -0400 |
commit | f1292e3d28309bbc81f61671164843cec4319bfa (patch) | |
tree | 2818cc0a5ec330c8197447e47ab441b3cfe5a6d1 | |
parent | c07da2e9704d2ba95efa34a4fde2747d973b4e4c (diff) | |
download | musl-f1292e3d28309bbc81f61671164843cec4319bfa.tar.gz musl-f1292e3d28309bbc81f61671164843cec4319bfa.tar.bz2 musl-f1292e3d28309bbc81f61671164843cec4319bfa.tar.xz musl-f1292e3d28309bbc81f61671164843cec4319bfa.zip |
fix omission of dtv setup in static linked programs on TLS variant I archs
apparently this was never noticed before because the linker normally
optimizes dynamic TLS models to non-dynamic ones when static linking,
thus eliminating the calls to __tls_get_addr which crash when the dtv
is missing. however, some libsupc++ code on ARM was calling
__tls_get_addr when static linked and crashing. the reason is unclear
to me, but with this issue fixed it should work now anyway.
-rw-r--r-- | src/env/__init_tls.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c index eb2a6e4a..a4704f06 100644 --- a/src/env/__init_tls.c +++ b/src/env/__init_tls.c @@ -26,9 +26,9 @@ void *__copy_tls(unsigned char *mem) mem += libc.tls_size - sizeof(struct pthread); mem -= (uintptr_t)mem & (align-1); td = (pthread_t)mem; - td->dtv = dtv; mem -= size; #endif + td->dtv = dtv; dtv[1] = mem; memcpy(mem, image, len); return td; |