libc: Give __thr_jtable protected visibility
This function pointer table is overwritten by libthr when it's loaded.
libc's pthread stubs are implemented by looking up an entry in this
table and invoking the function pointer contained in the entry.
pthread calls are fairly expensive even when libthr is not loaded: each
call involves indirection through the PLT, then through the GOT to look
up thr_jtable, then the function pointer itself. We can however
eliminate one level of indirection by disallowing preemption of the
thr_jtable symbol, and since the existence table is an internal
implementation detail, disabling preemption is unlikely to break
anything. This gives a modest improvement in some microbenchmarks which
call libc's pthread stubs.
Reviewed by: kib
MFC after: 1 month
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D50354