From owner-freebsd-current Tue Oct 29 10:15:36 2002 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 7F0A537B404 for ; Tue, 29 Oct 2002 10:15:34 -0800 (PST) Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F9B743E97 for ; Tue, 29 Oct 2002 10:15:33 -0800 (PST) (envelope-from archie@dellroad.org) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id KAA80197; Tue, 29 Oct 2002 10:00:09 -0800 (PST) Received: from arch20m.dellroad.org (localhost [127.0.0.1]) by arch20m.dellroad.org (8.12.6/8.12.6) with ESMTP id g9TI03ZE008081; Tue, 29 Oct 2002 10:00:03 -0800 (PST) (envelope-from archie@arch20m.dellroad.org) Received: (from archie@localhost) by arch20m.dellroad.org (8.12.6/8.12.6/Submit) id g9TI036f008080; Tue, 29 Oct 2002 10:00:03 -0800 (PST) From: Archie Cobbs Message-Id: <200210291800.g9TI036f008080@arch20m.dellroad.org> Subject: Re: gnome on current In-Reply-To: <200210291647.g9TGlVM5049992@vashon.polstra.com> "from John Polstra at Oct 29, 2002 08:47:31 am" To: John Polstra Date: Tue, 29 Oct 2002 10:00:03 -0800 (PST) Cc: current@FreeBSD.org, dfr@nlsystems.com X-Mailer: ELM [version 2.4ME+ PL88 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG John Polstra writes: > > > I think it would work if the symbol were defined strongly in libc_r. > > > > I think so too. I was trying to work out why this wasn't how things were > > done already. FWIW, linux's libpthread appears to be defining the > > pthread_* symbols strongly. > > I think the weak symbols have something to do with support for thread > cancellation. I didn't pay much attention at the time, so I don't > know the details. Here's the relevant commit message, I think (this > one taken from lib/libc_r/uthread/uthread_pause.c): > > date: 2001/01/24 13:03:34; author: deischen; state: Exp; lines: +4 -4 > Add weak definitions for wrapped system calls. In general: > > _foo - wrapped system call > foo - weak definition to _foo > > and for cancellation points: > > _foo - wrapped system call > __foo - enter cancellation point, call _foo(), leave > cancellation point > foo - weak definition to __foo To me it appears that weak symbols are not related to thread cancellation other than by coincidence. All this commit is saying is that the functionality of the libc_r version of "foo()" is split into two functions, one of which is a public entry point (__foo()) and the other of which is for internal use by libc_r (_foo()). The public entry point just calls the internal version after satisfying the requirement that the function be a cancellation point. In other words, weak symbol are used for non-cancellation point functions as well, and are not required for implemention cancellation points. It might have been slightly clearer if the _foo and __foo names had been reversed, so that "foo" always weakly referenced "_foo" whether or not the function was a cancellation point. But that would have probably caused a lot of changes in existing code (?). -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message