Prechádzať zdrojové kódy

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.
Rich Felker 12 rokov pred
rodič
commit
017bf140ff
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      src/ldso/dynlink.c

+ 1 - 1
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;