aboutsummaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/compat-stack-guard.patch
blob: c69a9c5350766200d8aa5022ee4593288d7d12c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 2857f7e..dce6fd8 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -103,11 +103,7 @@ extern void _start(void);
 #ifdef __UCLIBC_HAS_SSP__
 # include <dl-osinfo.h>
 static uintptr_t stack_chk_guard;
-# ifndef THREAD_SET_STACK_GUARD
-/* Only exported for architectures that don't store the stack guard canary
- * in local thread area.  */
 uintptr_t __stack_chk_guard attribute_relro;
-# endif
 # ifdef __UCLIBC_HAS_SSP_COMPAT__
 uintptr_t __guard attribute_relro;
 # endif
@@ -953,9 +949,8 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
 	stack_chk_guard = _dl_setup_stack_chk_guard ();
 # ifdef THREAD_SET_STACK_GUARD
 	THREAD_SET_STACK_GUARD (stack_chk_guard);
-# else
-	__stack_chk_guard = stack_chk_guard;
 # endif
+	__stack_chk_guard = stack_chk_guard;
 # ifdef __UCLIBC_HAS_SSP_COMPAT__
 	__guard = stack_chk_guard;
 # endif
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 315365a..78cd058 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -46,12 +46,7 @@ void *__libc_stack_end = NULL;
 # ifdef __UCLIBC_HAS_SSP__
 #  include <dl-osinfo.h>
 static uintptr_t stack_chk_guard;
-#  ifndef THREAD_SET_STACK_GUARD
-/* Only exported for architectures that don't store the stack guard canary
- * in thread local area. */
-/* for gcc-4.1 non-TLS */
 uintptr_t __stack_chk_guard attribute_relro;
-#  endif
 /* for gcc-3.x + Etoh ssp */
 #  ifdef __UCLIBC_HAS_SSP_COMPAT__
 uintptr_t __guard attribute_relro;
@@ -247,9 +242,8 @@ void __uClibc_init(void)
     stack_chk_guard = _dl_setup_stack_chk_guard();
 #  ifdef THREAD_SET_STACK_GUARD
     THREAD_SET_STACK_GUARD (stack_chk_guard);
-#  else
-    __stack_chk_guard = stack_chk_guard;
 #  endif
+    __stack_chk_guard = stack_chk_guard;
 #  ifdef __UCLIBC_HAS_SSP_COMPAT__
     __guard = stack_chk_guard;
 #  endif