#include <array_length.h>
#include <libc-early-init.h>
#include <dl-main.h>
+#include <list.h>
#include <assert.h>
const char *lossage = TLS_INIT_TP (tcbp);
if (__glibc_unlikely (lossage != NULL))
_dl_fatal_printf ("cannot set up thread-local storage: %s\n", lossage);
+#if THREAD_GSCOPE_IN_TCB
+ list_add (&THREAD_SELF->list, &GL (dl_stack_user));
+#endif
tls_init_tp_called = true;
return tcbp;
GL(dl_rtld_unlock_recursive) = rtld_lock_default_unlock_recursive;
#endif
+#if THREAD_GSCOPE_IN_TCB
+ INIT_LIST_HEAD (&GL (dl_stack_used));
+ INIT_LIST_HEAD (&GL (dl_stack_user));
+#endif
+
/* The explicit initialization here is cheaper than processing the reloc
in the _rtld_local definition's initializer. */
GL(dl_make_stack_executable_hook) = &_dl_make_stack_executable;
if (__glibc_unlikely (lossage != NULL))
_dl_fatal_printf ("cannot set up thread-local storage: %s\n",
lossage);
+#if THREAD_GSCOPE_IN_TCB
+ list_add (&THREAD_SELF->list, &GL (dl_stack_user));
+#endif
}
/* Make sure no new search directories have been added. */