]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Avoid conflicts with libc symbols in libthr jump table.
authorkib <kib@FreeBSD.org>
Wed, 31 Jul 2019 19:27:20 +0000 (19:27 +0000)
committerkib <kib@FreeBSD.org>
Wed, 31 Jul 2019 19:27:20 +0000 (19:27 +0000)
commit60e92f3b783f5d6aeefe15bb193e504ac38968a2
tree0417e1cd360c266d0974d5806b0461f12521f05a
parent4168d73dc2403a1bbe6fccc5e9910fd0a91afd07
Avoid conflicts with libc symbols in libthr jump table.

In some corner cases of static linking and unexpected libraries order
on the linker command line, libc symbol might preempt the same libthr
symbol, in which case libthr jump table points back to libc causing
either infinite recursion or loop.  Handle all of such symbols by
using private libthr names for them, ensuring that the right pointers
are installed into the table.

In collaboration with: arichardson
PR: 239475
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D21088
21 files changed:
lib/libthr/thread/thr_attr.c
lib/libthr/thread/thr_cancel.c
lib/libthr/thread/thr_clean.c
lib/libthr/thread/thr_cond.c
lib/libthr/thread/thr_detach.c
lib/libthr/thread/thr_equal.c
lib/libthr/thread/thr_exit.c
lib/libthr/thread/thr_fork.c
lib/libthr/thread/thr_getthreadid_np.c
lib/libthr/thread/thr_init.c
lib/libthr/thread/thr_join.c
lib/libthr/thread/thr_kill.c
lib/libthr/thread/thr_main_np.c
lib/libthr/thread/thr_mutex.c
lib/libthr/thread/thr_mutexattr.c
lib/libthr/thread/thr_once.c
lib/libthr/thread/thr_private.h
lib/libthr/thread/thr_rwlock.c
lib/libthr/thread/thr_self.c
lib/libthr/thread/thr_sig.c
lib/libthr/thread/thr_spec.c