--- src/libexec/rtld-elf/rtld.c Fri Aug 20 08:50:35 2004 +++ /home/refugee/freebsd/src/libexec/rtld-elf/rtld.c Fri Sep 17 02:31:57 2004 @@ -390,6 +390,17 @@ 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(); @@ -409,17 +420,6 @@ 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);