From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7387 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Concerns about dlclose() behaviour Date: Wed, 15 Apr 2015 03:17:07 -0400 Message-ID: <20150415071707.GS6817@brightrain.aerifal.cx> References: <20150414231627.GR6817@brightrain.aerifal.cx> <1429079357.97612.YahooMailBasic@web160405.mail.bf1.yahoo.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1429082242 21705 80.91.229.3 (15 Apr 2015 07:17:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Apr 2015 07:17:22 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7400-gllmg-musl=m.gmane.org@lists.openwall.com Wed Apr 15 09:17:21 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YiHZZ-00007U-JK for gllmg-musl@m.gmane.org; Wed, 15 Apr 2015 09:17:21 +0200 Original-Received: (qmail 28244 invoked by uid 550); 15 Apr 2015 07:17:19 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 28226 invoked from network); 15 Apr 2015 07:17:19 -0000 Content-Disposition: inline In-Reply-To: <1429079357.97612.YahooMailBasic@web160405.mail.bf1.yahoo.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7387 Archived-At: On Tue, Apr 14, 2015 at 11:29:17PM -0700, Brad Conroy wrote: > I recently checked out the netsurf-framebuffer package from debian > and was bothered that all of the backends were compiled in... > thus requiring a bunch of extra dependencies and increasing footprint. > > I am currently patching it to make the backends modular, but ran into > a concern about musl compatibility. > > libnsfb is set up in such a way that each backend has (static) functions > exported in a single struct. With normal dlclose() functionality, I could > use dlopen to get a module and run its init function, then if it fails, just > dlclose() it and try the next backend (all using the same variable and > function names, thus simplifying the implementation) > > I am thinking this will still work on musl in a way similar to using > LD_PRELOAD, but wanted to verify before moving forward since many > nsfb users also use musl. If I understand correctly, what you're hoping is that dlclose will remove the symbols loaded by dlopen so that you can replace them with new definitions. This is not going to happen, but I'm not sure your conclusion that you need it to happen is correct. If you're using RTLD_LOCAL, the names aren't even global to begin with. How are you calling/accessing them? By dlsym? Or is some other library getting loaded and binding to the names in the global (RTLD_GLOBAL) namespace? Rich