about summary refs log tree commit diff
path: root/src/env
diff options
context:
space:
mode:
Diffstat (limited to 'src/env')
-rw-r--r--src/env/__init_tls.c5
-rw-r--r--src/env/__stack_chk_fail.c3
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)