@@ -733,7 +733,7 @@ match_version (const char *string, struct link_map *map)
return 0;
}
-static bool tls_init_tp_called;
+bool __rtld_tls_init_tp_called;
static void *
init_tls (void)
@@ -799,7 +799,7 @@ cannot allocate TLS data structures for initial thread\n");
const char *lossage = TLS_INIT_TP (tcbp);
if (__glibc_unlikely (lossage != NULL))
_dl_fatal_printf ("cannot set up thread-local storage: %s\n", lossage);
- tls_init_tp_called = true;
+ __rtld_tls_init_tp_called = true;
return tcbp;
}
@@ -1916,7 +1916,7 @@ ERROR: '%s': cannot process note segment.\n", _dl_argv[0]);
an old kernel that can't perform TLS_INIT_TP, even if no TLS is ever
used. Trying to do it lazily is too hairy to try when there could be
multiple threads (from a non-TLS-using libpthread). */
- bool was_tls_init_tp_called = tls_init_tp_called;
+ bool was_tls_init_tp_called = __rtld_tls_init_tp_called;
if (tcbp == NULL)
tcbp = init_tls ();
@@ -2267,7 +2267,7 @@ ERROR: '%s': cannot process note segment.\n", _dl_argv[0]);
_dl_protect_relro (l);
/* Add object to slot information data if necessasy. */
- if (l->l_tls_blocksize != 0 && tls_init_tp_called)
+ if (l->l_tls_blocksize != 0 && __rtld_tls_init_tp_called)
_dl_add_to_slotinfo (l, true);
}
}
@@ -2312,7 +2312,7 @@ ERROR: '%s': cannot process note segment.\n", _dl_argv[0]);
consider_profiling);
/* Add object to slot information data if necessasy. */
- if (l->l_tls_blocksize != 0 && tls_init_tp_called)
+ if (l->l_tls_blocksize != 0 && __rtld_tls_init_tp_called)
_dl_add_to_slotinfo (l, true);
}
rtld_timer_stop (&relocate_time, start);
@@ -2338,7 +2338,7 @@ ERROR: '%s': cannot process note segment.\n", _dl_argv[0]);
_dl_allocate_tls_init (tcbp);
/* And finally install it for the main thread. */
- if (! tls_init_tp_called)
+ if (! __rtld_tls_init_tp_called)
{
const char *lossage = TLS_INIT_TP (tcbp);
if (__glibc_unlikely (lossage != NULL))
@@ -1139,6 +1139,9 @@ extern void *_dl_allocate_tls_storage (void) attribute_hidden;
extern void *_dl_allocate_tls_init (void *);
rtld_hidden_proto (_dl_allocate_tls_init)
+/* True if the TCB has been set up. */
+extern bool __rtld_tls_init_tp_called attribute_hidden;
+
/* Deallocate memory allocated with _dl_allocate_tls. */
extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb);
rtld_hidden_proto (_dl_deallocate_tls)