summaryrefslogtreecommitdiff
path: root/src/ldso
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-10-07 20:19:11 -0400
committerRich Felker <dalias@aerifal.cx>2012-10-07 20:19:11 -0400
commit017bf140ffb41e9a016df84dc4c1806e0686b28a (patch)
tree0bebd70ff013cf5f65375c4a4d0a26eff716cf0a /src/ldso
parent00902c7384963192dda8a15938786a36dca7d7ab (diff)
downloadmusl-017bf140ffb41e9a016df84dc4c1806e0686b28a.tar.gz
musl-017bf140ffb41e9a016df84dc4c1806e0686b28a.tar.bz2
musl-017bf140ffb41e9a016df84dc4c1806e0686b28a.tar.xz
musl-017bf140ffb41e9a016df84dc4c1806e0686b28a.zip
fix breakage due to initializing thread pointer when loading libs
at initial program load, all libraries must be loaded before the thread pointer can be setup, since the TP-relative addresses of all initial TLS objects must be constant.
Diffstat (limited to 'src/ldso')
-rw-r--r--src/ldso/dynlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 93cfb429..33ef7e55 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -533,7 +533,7 @@ static struct dso *load_library(const char *name)
/* Add a shortname only if name arg was not an explicit pathname. */
if (pathname != name) p->shortname = strrchr(p->name, '/')+1;
if (p->tls_image) {
- if (!__pthread_self_init()) {
+ if (runtime && !__pthread_self_init()) {
free(p);
munmap(map, map_len);
return 0;