From owner-freebsd-current@FreeBSD.ORG Sat Nov 22 09:39:26 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02F5916A4CE for ; Sat, 22 Nov 2003 09:39:26 -0800 (PST) Received: from basement.kutulu.org (pcp03610121pcs.longhl01.md.comcast.net [68.49.239.235]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07D1843FDD for ; Sat, 22 Nov 2003 09:39:24 -0800 (PST) (envelope-from kutulu@kutulu.org) Received: from wombat.localnet (wombat.localnet [192.168.69.3]) by basement.kutulu.org (Postfix) with ESMTP id B93CDAA49; Sat, 22 Nov 2003 12:39:22 -0500 (EST) Received: by wombat.localnet (Postfix, from userid 1001) id 0FC9BB856; Sat, 22 Nov 2003 12:38:42 -0500 (EST) Date: Sat, 22 Nov 2003 12:38:41 -0500 From: Michael Edenfield To: Tim Kientzle Message-ID: <20031122173840.GD15294@wombat.localnet> Mail-Followup-To: Tim Kientzle , Leo Bicknell , freebsd-current@freebsd.org References: <200311182307.hAIN7Wpm000717@dyson.jdyson.com> <20031118164905.R35009@pooker.samsco.home> <20031119141059.GA14308@madman.celabo.org> <20031119141950.GA95734@ussenterprise.ufp.org> <3FBEA209.20006@acm.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Xm/fll+QQv+hsKip" Content-Disposition: inline In-Reply-To: <3FBEA209.20006@acm.org> X-Mailer: Mutt http://www.mutt.org/ X-Accept-Language: en X-PGP-Key: http://www.kutulu.org/pgp/kutulu.asc X-PGP-Fingerprint: 1CE0 3C31 7013 D529 406D 37DC 09CC CD84 A46C 878F User-Agent: Mutt/1.5.5.1i cc: Leo Bicknell cc: freebsd-current@freebsd.org Subject: Re: Unfortunate dynamic linking for everything X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2003 17:39:26 -0000 --Xm/fll+QQv+hsKip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Tim Kientzle [031121 18:40]: > Leo Bicknell wrote: > >To boot a machine into single user mode you need a kernel, init, > >and /bin/sh (minimally). It would seem to me that alone is a good > >argument for those three things to be static. > * Rewrite dlopen() to not require dynamic linking. >=20 > There were some patches for this submitted at one point. > As I recall, the people who looked at them were not entirely > comfortable with them. (I'd be concerned about version > conflict problems with this approach: what happens when > a dynamically-loaded NSS module refers to a libc function? > Does that get resolved to the already statically-linked > version? Or does another copy of libc get dynamically linked > with potential version conflicts? Does anyone know?) >=20 > I personally think this is worth researching, though I > have my doubts. I took a look at the glibc implementation of dlopen() breifly, since that does function from within libc.a. It appears that you *do* get more than one loaded copy of libc. The copy of dlopen() that is built when #ifndef SHARED includes a flag: __libc_multiple_libcs that is set to 1. Additionally, I was reading comments from some of the glibc developers who basically claim that dlopen() in a static binary *only* works if you dlopen() a NSS module. It isn't guaranteed to work in the general case because the static binary has no DYNAMIC elf section to resolve external references etc. I suspect this means NSS modules are limited in what they are allowed to reference and still work? I haven't looked in much detail on their implementation but it certainly looks like a hack just to make NSS work, which I don't think is a good long-term solution. --Mike --Xm/fll+QQv+hsKip Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/v58gCczNhKRsh48RAgLCAJ9C/TIJ6cRTldlNNLj3n3ml0aimUwCgqwzf e0HG+k1+0IUq+SqurFA2QuQ= =DbPO -----END PGP SIGNATURE----- --Xm/fll+QQv+hsKip--