From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10879 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Reviving planned ldso changes Date: Wed, 4 Jan 2017 11:51:09 +0100 Message-ID: <20170104105108.GD6695@port70.net> References: <20170103054351.GA8459@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1483527094 7929 195.159.176.226 (4 Jan 2017 10:51:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Jan 2017 10:51:34 +0000 (UTC) User-Agent: Mutt/1.6.0 (2016-04-01) To: musl@lists.openwall.com Original-X-From: musl-return-10892-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 04 11:51:30 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1cOjA8-0000Ul-LT for gllmg-musl@m.gmane.org; Wed, 04 Jan 2017 11:51:20 +0100 Original-Received: (qmail 32221 invoked by uid 550); 4 Jan 2017 10:51:22 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 32197 invoked from network); 4 Jan 2017 10:51:21 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20170103054351.GA8459@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:10879 Archived-At: * Rich Felker [2017-01-03 00:43:51 -0500]: > One item that's been on the agenda for a long time (maybe 1.5 years > now?) is planned dynamic linker improvements. The thread "Further > dynamic linker optimizations" from summer 2015 covered parts but maybe > not all of what I had in mind. > > - Instead of a global flag for each library, have a separate linked > list for globally visible libraries. This will speed up symbol > lookup (by skipping non-global ones, and skipping checking the > global flag) and also makes it so that load order searching can be > done based on the order in which the libraries became global, rather > than their original load order when they might have been non-global. > > - Dependency-order ctor execution. I think the walk order looks > something like, starting at a given node (initially the main app or > new library being loaded dynamically), traversing to its first > deps[] entry that hasn't been constructed, or, if none remain, > executing its ctors then traversing back to its needed_by. This > process avoids the need for any call recursion and should be > near-optimal (if not optimal) provided the position in a dso's > deps[] list is saved in the dso struct. > > - Recursive dlopen improvements. The thread "dlopen deadlock" from > January 2016 covers some of the issues. I don't think we reached a > complete conclusion/solution, but for reasonable cases where it's > clear that dlopen *should* work without deadlock, I think we have a > proposed design that works. > > - Possibly other optimizations I've left out... - symbol lookup logic is duplicated between do_dlsym and find_sym, it would be nice to do that with common code path if possible.