]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rtld: workaround for broken ABI
authorKonstantin Belousov <kib@FreeBSD.org>
Sat, 10 Apr 2021 12:32:24 +0000 (15:32 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Sat, 10 Apr 2021 14:33:33 +0000 (17:33 +0300)
commit08bfbd43594b7642de0d2487550f36b0ee1eceba
tree2eeb3c8acec61c3de5be467469c8fdea07f3780d
parent4d7f08c84bcfcd75ba23b06e07a8e5dba1d4a44f
rtld: workaround for broken ABI

Right now, libthr does not initialize RtldLockInfo.rtli_version when calling
_rtld_thread_init(), which makes versioning the interface troublesome.

Add a workaround: if the calling object of _rtld_thread_init() exports
the "_pli_rtli_version" symbol, then consider rtli_version initialized.
Otherwise, forcibly set it to RTLI_VERSION_ONE, currently defined as
RTLI_VERSION.

Export "_pli_rtli_version" from libthr and properly initialize rtli_version.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D29633
lib/libthr/pthread.map
lib/libthr/thread/thr_rtld.c
libexec/rtld-elf/rtld_lock.c
libexec/rtld-elf/rtld_lock.h