From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2437 Path: news.gmane.org!not-for-mail From: Isaac Dunham Newsgroups: gmane.linux.lib.musl.general Subject: Re: static linking and dlopen Date: Sat, 8 Dec 2012 23:30:59 -0800 Message-ID: <20121208233059.f8616b22.idunham@lavabit.com> 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 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1355038272 14350 80.91.229.3 (9 Dec 2012 07:31:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2012 07:31:12 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2438-gllmg-musl=m.gmane.org@lists.openwall.com Sun Dec 09 08:31:26 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 1ThbME-0004vs-9i for gllmg-musl@plane.gmane.org; Sun, 09 Dec 2012 08:31:26 +0100 Original-Received: (qmail 7533 invoked by uid 550); 9 Dec 2012 07:31:13 -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 7525 invoked from network); 9 Dec 2012 07:31:13 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=UI5GtD9/YmSSPZgIcxOlLMM22QmgoAvpdF8pOMWOgmNSVXKlCaLjKNOgz0GLZCWqEm5tKx38DjBay11D3tMj6E4h5RxU1TqKcLxUCP+VOmYScC5EOFsBqTWehjN6SWKvsS21lxCbcCaMUIaTVown+e/A/haKJenccsDK2DzNh44=; h=Date:From:To:Subject:Message-Id:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; In-Reply-To: <20121209025529.GF23126@port70.net> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; i486-pc-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:2437 Archived-At: On Sun, 9 Dec 2012 03:55:30 +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) Under at least glibc, this is supported. This is what gcc/ld does with "-static -shared". > in that case dlopen() would work and even dlclose() > can be safe (as the programmer has control over the > entire code) > > of course care should be taken and it might not be > very useful but one could implement loadable/unloadable > plugins with static linking -- Isaac Dunham