rtld-elf - Notify thread state to optimize relocations
* Add shims to allow libthread_xu to notify rtld when threading
is being used.
* Requires weak symbols in libc which are overriden by rtld-elf.
* Implement the feature in rtld-elf and use it to avoid making calls
to lwp_gettid(). When threaded, use tls_get_tcb() (which does not
require a system call) instead of lwp_gettid(). When not threaded,
just use a constant.
NOTE: We cannot use tls_get_tcb() unconditionally because the tcb
is not setup during early relocations. So do this whack-a-mole
to make it work.
* This leaves just the sigprocmask wrappers around rtld-elf (which
are needed to prevent stacked relocations from signal handlers).
Poked-by: mjg
UnifiedSplitRaw