X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fldso%2Fdynlink.c;h=1489f7d3c86ff19e595c4993a4a973a5b92e0ef6;hp=93cfb429c76f9f45d271afda2e980d0e42083e62;hb=31f340a17a0024b71e35fd6378d9a3caca050d43;hpb=00902c7384963192dda8a15938786a36dca7d7ab diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index 93cfb429..1489f7d3 100644 --- a/src/ldso/dynlink.c +++ b/src/ldso/dynlink.c @@ -105,7 +105,7 @@ static pthread_mutex_t init_fini_lock = { ._m_type = PTHREAD_MUTEX_RECURSIVE }; struct debug *_dl_debug_addr = &debug; -#define AUX_CNT 24 +#define AUX_CNT 38 #define DYN_CNT 34 static void decode_vec(size_t *v, size_t *a, size_t cnt) @@ -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; @@ -627,16 +627,6 @@ static void reloc_all(struct dso *p) } } -static void free_all(struct dso *p) -{ - struct dso *n; - while (p) { - n = p->next; - if (p->map && p!=libc && p!=head) free(p); - p = n; - } -} - static size_t find_dyn(Phdr *ph, size_t cnt, size_t stride) { for (; cnt--; ph = (void *)((char *)ph + stride)) @@ -967,7 +957,7 @@ void *__dynlink(int argc, char **argv) debug.state = 0; _dl_debug_state(); - if (ssp_used) __init_ssp(auxv); + if (ssp_used) __init_ssp((void *)aux[AT_RANDOM]); atexit(do_fini); do_init_fini(tail);