summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libexec/rtld-elf/rtld.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 5740e91..2741c13 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -390,6 +390,17 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
exit (0);
}
+ /* setup TLS for main thread */
+ dbg("initializing initial thread local storage");
+ STAILQ_FOREACH(entry, &list_main, link) {
+ /*
+ * Allocate all the initial objects out of the static TLS
+ * block even if they didn't ask for it.
+ */
+ allocate_tls_offset(entry->obj);
+ }
+ allocate_initial_tls(obj_list);
+
if (relocate_objects(obj_main,
ld_bind_now != NULL && *ld_bind_now != '\0', &obj_rtld) == -1)
die();
@@ -410,17 +421,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
dbg("initializing thread locks");
lockdflt_init();
- /* setup TLS for main thread */
- dbg("initializing initial thread local storage");
- STAILQ_FOREACH(entry, &list_main, link) {
- /*
- * Allocate all the initial objects out of the static TLS
- * block even if they didn't ask for it.
- */
- allocate_tls_offset(entry->obj);
- }
- allocate_initial_tls(obj_list);
-
/* Make a list of init functions to call. */
objlist_init(&initlist);
initlist_add_objects(obj_list, preload_tail, &initlist);
OpenPOWER on IntegriCloud