Date: Wed, 11 Feb 2015 18:30:15 -0600
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Konstantin Belousov <kostikbel@gmail.com>
Cc: threads@freebsd.org, arch@freebsd.org
Subject: Re: Fixing dlopen("libpthread.so")
Message-ID: <54DBF417.4050206@FreeBSD.org>
In-Reply-To: <20141226165337.GJ1754@kib.kiev.ua>
References: <20141226165337.GJ1754@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On 12/26/2014 10:53 AM, Konstantin Belousov wrote: > [Long] > Proposed patch does the following: [...] It seems libthr.3 needs to be updated for the dlopen(3) support, to remove some of r272070. Also note the ordering comment (which I know you may not be ready to change yet). > INTERACTION WITH RUN-TIME LINKER > The libthr library must appear before libc in the global order of > depended objects. > > Loading libthr with the dlopen(3) call in the process after the program > binary is activated is not supported, and causes miscellaneous and hard- > to-diagnose misbehaviour. This is due to libthr interposing several > important libc symbols to provide thread-safe services. In particular, > errno and the locking stubs from libc are affected. This requirement is > currently not enforced. > > If the program loads any modules at run-time, and those modules may > require threading services, the main program binary must be linked with > libpthread, even if it does not require any services from the library. > > libthr cannot be unloaded; the dlclose(3) function does not perform any > action when called with a handle for libthr. One of the reasons is that > the interposing of libc functions cannot be undone. As for the dlclose(3) refusing to work on libthr, I cannot find the supporting code. Where is it? Thanks, Bryan [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJU2/QfAAoJEDXXcbtuRpfPNEQIAJHLs6BDBmKoHfKdtNJF/Fqq WFfnHY8niMTgsF9EXQfOmBNxROXYKNK8oQjvJ0jLD1k0Ep1bhKDARBntxf55R6yc oueO2rdMH7014WEcNLGbLQF5jkpcpN0SsgGaNfNpMVqlUeVDnAhkglVG/xKPUgC6 bIjeja4/YWD5lXA4P/lwIPbJHbuhAoYfdoz2oyJ1umhQskbPjj1GYU3fpUr9hX1C zQBdSDlC/hkDFuO6gsan2/S5471tEMV0YcaeLRVaqjJYjk6MO0pmcF8Ta7OPdRkr 3sBQfWt/wTygDwyoL+xcuRDbibEfi0Kk8/FaPonyiN/gdf6ll8uOLx0W+as1v8g= =Vz97 -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54DBF417.4050206>
