This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
About tls comment.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 1 Nov 2013 17:44:00 +0100
- Subject: About tls comment.
- Authentication-results: sourceware.org; auth=none
Hi, when I looked at bug 13823 I came to following comment.
/* We do not initialize any of the TLS functionality unless any of the
initial modules uses TLS. This makes dynamic loading of modules with
TLS impossible, but to support it requires either eagerly doing setup
now or lazily doing it later. Doing it now makes us incompatible with
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;
if (tcbp == NULL)
tcbp = init_tls ();
It dates back to 2002. This comment puzzles me, as we do tls
initialization just below or did I missed something?