From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2449 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: static linking and dlopen Date: Sun, 9 Dec 2012 16:53:14 -0500 Message-ID: <20121209215314.GG20323@brightrain.aerifal.cx> References: <20121208225237.GV20323@brightrain.aerifal.cx> <1355083763.9353.2@driftwood> 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 1355090008 14710 80.91.229.3 (9 Dec 2012 21:53:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2012 21:53:28 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2450-gllmg-musl=m.gmane.org@lists.openwall.com Sun Dec 09 22:53:41 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 1Thood-000622-IE for gllmg-musl@plane.gmane.org; Sun, 09 Dec 2012 22:53:39 +0100 Original-Received: (qmail 25929 invoked by uid 550); 9 Dec 2012 21:53:26 -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 25918 invoked from network); 9 Dec 2012 21:53:26 -0000 Content-Disposition: inline In-Reply-To: <1355083763.9353.2@driftwood> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2449 Archived-At: On Sun, Dec 09, 2012 at 02:09:23PM -0600, Rob Landley wrote: > On 12/08/2012 04:52:37 PM, Rich Felker wrote: > >The source of all these problems is basically the same as the benefit > >of static linking: the fact that the linker resolves, statically at > >link time, which object files are needed to satisfy the needs of the > >program. With dlopen, however, there is no static answer; *any* object > >is potentially-needed, not directly by the main program, but possibly > >by loaded modules. > > Is there some way you could put a dlopen() symbol in libc.a that > forces a build break? Perhaps a redirect to > dlopen_is_not_compatible_with_static_linking_go_read_posix? The dlopen in libc.a simply always-fails. For programs where loading modules is optional, this is probably the ideal behavior. Rich