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
This commit is contained in:
Konstantin Belousov 2019-07-31 20:04:39 +00:00
parent ed2393eacf
commit 3638455c92
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350483

View File

@ -1021,8 +1021,6 @@ void __thr_cleanup_push_imp(void (*)(void *), void *,
void __thr_cleanup_pop_imp(int);
void _thr_cleanup_push(void (*)(void *), void *);
void _thr_cleanup_pop(int);
void _thr_cancel_enter(struct pthread *);
void _thr_cancel_leave(struct pthread *, int);
void _Tthr_testcancel(void);
int _thr_cancel(pthread_t);
int _thr_atfork(void (*)(void), void (*)(void), void (*)(void));