summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <natanael.copa@gmail.com>2009-11-27 16:12:42 +0000
committerAustin Foxley <austinf@cetoncorp.com>2009-11-27 10:01:35 -0800
commit9ec568d46da86768787782a83e3351f350970d6e (patch)
treea3f65fb4b69f9c53036ff4419d2f9d927579b6ec
parent9508808a1d7d8bf33b77273bb8187bd038bc2244 (diff)
ldso: initialize stack_chk_guard after TLS is initialized
stack_chk_guard is on thread local storage so we need to init TLS before we can init stack_chk_guard. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
-rw-r--r--ldso/ldso/ldso.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 021f109cd..555eeb9a1 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -376,19 +376,6 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
_dl_init_static_tls = &_dl_nothread_init_static_tls;
#endif
-#ifdef __UCLIBC_HAS_SSP__
- /* Set up the stack checker's canary. */
- stack_chk_guard = _dl_setup_stack_chk_guard ();
-# ifdef THREAD_SET_STACK_GUARD
- THREAD_SET_STACK_GUARD (stack_chk_guard);
-# ifdef __UCLIBC_HAS_SSP_COMPAT__
- __guard = stack_chk_guard;
-# endif
-# else
- __stack_chk_guard = stack_chk_guard;
-# endif
-#endif
-
/* At this point we are now free to examine the user application,
* and figure out which libraries are supposed to be called. Until
* we have this list, we will not be completely ready for dynamic
@@ -944,6 +931,19 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
tcbp = init_tls ();
}
#endif
+#ifdef __UCLIBC_HAS_SSP__
+ /* Set up the stack checker's canary. */
+ stack_chk_guard = _dl_setup_stack_chk_guard ();
+# ifdef THREAD_SET_STACK_GUARD
+ THREAD_SET_STACK_GUARD (stack_chk_guard);
+# ifdef __UCLIBC_HAS_SSP_COMPAT__
+ __guard = stack_chk_guard;
+# endif
+# else
+ __stack_chk_guard = stack_chk_guard;
+# endif
+#endif
+
_dl_debug_early("Beginning relocation fixups\n");