diff options
author | Rich Felker <dalias@aerifal.cx> | 2015-04-13 19:24:51 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-04-13 19:24:51 -0400 |
commit | 19a1fe670acb3ab9ead0fe31859ca7d4fe40dd54 (patch) | |
tree | c2a2b1e2e4ddb58416a925b1e64485ac4972f4e4 /src/env | |
parent | 71f099cb7db821c51d8f39dfac622c61e54d794c (diff) | |
download | musl-19a1fe670acb3ab9ead0fe31859ca7d4fe40dd54.tar.gz musl-19a1fe670acb3ab9ead0fe31859ca7d4fe40dd54.tar.xz musl-19a1fe670acb3ab9ead0fe31859ca7d4fe40dd54.zip |
remove remnants of support for running in no-thread-pointer mode
since 1.1.0, musl has nominally required a thread pointer to be setup. most of the remaining code that was checking for its availability was doing so for the sake of being usable by the dynamic linker. as of commit 71f099cb7db821c51d8f39dfac622c61e54d794c, this is no longer necessary; the thread pointer is now valid before any libc code (outside of dynamic linker bootstrap functions) runs. this commit essentially concludes "phase 3" of the "transition path for removing lazy init of thread pointer" project that began during the 1.1.0 release cycle.
Diffstat (limited to 'src/env')
-rw-r--r-- | src/env/__init_tls.c | 5 | ||||
-rw-r--r-- | src/env/__stack_chk_fail.c | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c index ac4d9e7f..67f14094 100644 --- a/src/env/__init_tls.c +++ b/src/env/__init_tls.c @@ -15,7 +15,6 @@ int __init_tp(void *p) int r = __set_thread_area(TP_ADJ(p)); if (r < 0) return -1; if (!r) libc.can_do_threads = 1; - libc.has_thread_pointer = 1; td->tid = __syscall(SYS_set_tid_address, &td->tid); td->locale = &libc.global_locale; td->robust_list.head = &td->robust_list.head; @@ -112,8 +111,8 @@ void __init_tls(size_t *aux) mem = builtin_tls; } - /* Failure to initialize thread pointer is fatal if TLS is used. */ - if (__init_tp(__copy_tls(mem)) < 0 && tls_phdr) + /* Failure to initialize thread pointer is always fatal. */ + if (__init_tp(__copy_tls(mem)) < 0) a_crash(); } #else diff --git a/src/env/__stack_chk_fail.c b/src/env/__stack_chk_fail.c index 87ac473d..cc55460b 100644 --- a/src/env/__stack_chk_fail.c +++ b/src/env/__stack_chk_fail.c @@ -9,8 +9,7 @@ void __init_ssp(void *entropy) if (entropy) memcpy(&__stack_chk_guard, entropy, sizeof(uintptr_t)); else __stack_chk_guard = (uintptr_t)&__stack_chk_guard * 1103515245; - if (libc.has_thread_pointer) - __pthread_self()->canary = __stack_chk_guard; + __pthread_self()->canary = __stack_chk_guard; } void __stack_chk_fail(void) |