From owner-freebsd-current Fri Oct 15 11:26:43 1999 Delivered-To: freebsd-current@freebsd.org Received: from uni4nn.gn.iaf.nl (osmium.gn.iaf.nl [193.67.144.12]) by hub.freebsd.org (Postfix) with ESMTP id 245531515C for ; Fri, 15 Oct 1999 11:26:36 -0700 (PDT) (envelope-from wilko@yedi.iaf.nl) Received: from yedi.iaf.nl (uucp@localhost) by uni4nn.gn.iaf.nl (8.9.2/8.9.2) with UUCP id UAA08731; Fri, 15 Oct 1999 20:14:56 +0200 (MET DST) Received: (from wilko@localhost) by yedi.iaf.nl (8.9.3/8.9.3) id UAA63994; Fri, 15 Oct 1999 20:09:57 +0200 (CEST) (envelope-from wilko) From: Wilko Bulte Message-Id: <199910151809.UAA63994@yedi.iaf.nl> Subject: Re: World breakage in libc_r? In-Reply-To: <199910142225.SAA06440@pcnet1.pcnet.com> from Daniel Eischen at "Oct 14, 1999 6:25:41 pm" To: eischen@vigrid.com (Daniel Eischen) Date: Fri, 15 Oct 1999 20:09:57 +0200 (CEST) Cc: eischen@vigrid.com, jb@cimlogic.com.au, current@FreeBSD.ORG, jdp@polstra.com, marcel@scc.nl X-Organisation: Private FreeBSD site - Arnhem, The Netherlands X-pgp-info: PGP public key at 'finger wilko@freefall.freebsd.org' X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG As Daniel Eischen wrote ... Sheer curiosity and most likely a somewhat dim question: what the h* is a weak versus a strong symbol? Thanks, Wilko > John Birrell wrote: > > Weak symbols don't work too well _between_ libraries. If libc is linked > > before libpthread, any unresolved references when libc is searched will > > use the weak symbols from there, regardless of the fact that a strong > > symbol exists in libpthread. If libc is linked after libpthread, then > > you can have libc internal references to things that should been resolved > > to things in libpthread, but end up using the weak symbols in libc > > because that is all there is left. 8-( > > > > Not a simple problem to solve. The current tools don't help at all. A > > second library pass to resolve weak symbols would have been better. It's > > too late for that now, though, since you can change the semantics on the > > shared loader. > > It'd be interesting to know how Solaris does this. I see they don't > supply a static libpthread, just the dynamic. It seems they do use > a strong symbol in libpthread, and a weak one in libc: > > vfr [80] $ nm /usr/lib/libc.so.1 | grep pthread_mutex_lock > [4394] | 596188| 44|FUNC |WEAK |0 |12 |_pthread_mutex_lock > [2980] | 596188| 44|FUNC |WEAK |0 |12 |pthread_mutex_lock > vfr [81] $ nm /usr/lib/libpthread.so.1 | grep pthread_mutex_lock > [333] | 20704| 8|FUNC |GLOB |0 |8 |_pthread_mutex_lock > [107] | 20704| 8|FUNC |WEAK |0 |8 |pthread_mutex_lock -- | / o / / _ Arnhem, The Netherlands - Powered by FreeBSD - |/|/ / / /( (_) Bulte WWW : http://www.tcja.nl http://www.freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message