rtld - Support static TLS bindings for late-loaded shared libraries
* Allow late (manual) dlopen()s to load shared libraries which
use static TLS variables, as long as there is space. Do proper
late-binding and initialize the area for all threads.
* rtld will cache a symbol lookup on first-need for:
"_pthread_distribute_static_tls" and then call it as needed to
initialize late-bound static TLS space.
This symbol is weakly bounded to __libc_distribute_static_tls in libc,
and strongly overridden by _libthread_distribute_static_tls in
libthread_xu.
* Fixes mesa glx-tls and others.
* Test code from FreeBSD. Also tested with other combinations
including a pthread_create() and -static compilation.
https://github.com/dumbbell/test-tls-initial-exec