From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2434 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: static linking and dlopen Date: Sat, 8 Dec 2012 22:10:11 -0500 Message-ID: <20121209031011.GY20323@brightrain.aerifal.cx> References: <20121208225237.GV20323@brightrain.aerifal.cx> <20121209025529.GF23126@port70.net> 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 1355022628 16246 80.91.229.3 (9 Dec 2012 03:10:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2012 03:10:28 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2435-gllmg-musl=m.gmane.org@lists.openwall.com Sun Dec 09 04:10:42 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ThXHq-0005pY-7j for gllmg-musl@plane.gmane.org; Sun, 09 Dec 2012 04:10:38 +0100 Original-Received: (qmail 9335 invoked by uid 550); 9 Dec 2012 03:10:24 -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 9305 invoked from network); 9 Dec 2012 03:10:24 -0000 Content-Disposition: inline In-Reply-To: <20121209025529.GF23126@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2434 Archived-At: On Sun, Dec 09, 2012 at 03:55:30AM +0100, Szabolcs Nagy wrote: > i think one could make a dso that has no dependency > (all dependencies are linked into it including libc), > and no pointers are passed (directly or indirectly) > to types which are not entirely part of the abi > between the dso and the main binary > (ie no FILE* or anything that might have different > internals on the two sides) It's not that simple. There's always at least one piece of state that's shared: the brk. 2 versions of malloc running will always cause horrible problems unless they're aware of each other or avoid using brk at all. There's also the issue of stdio flushing at exit. The main program's exit() can't flush the stdio streams belonging to the dso. Thread-local storage in the dso would also be another problematic area.. Rich