From owner-freebsd-current Fri Nov 8 7:48:18 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 867DD37B401 for ; Fri, 8 Nov 2002 07:48:17 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1062443E42 for ; Fri, 8 Nov 2002 07:48:17 -0800 (PST) (envelope-from eischen@pcnet1.pcnet.com) Received: from localhost (eischen@localhost) by mail.pcnet.com (8.12.3/8.12.1) with ESMTP id gA8FmGVA008748; Fri, 8 Nov 2002 10:48:16 -0500 (EST) Date: Fri, 8 Nov 2002 10:48:16 -0500 (EST) From: Daniel Eischen To: Alexander Kabaev Cc: dfr@nlsystems.com, current@freebsd.org Subject: Re: [PATCH: libc]Re: gnome on current In-Reply-To: <20021031132345.0c6901a3.ak03@gte.com> Message-ID: MIME-Version: 1.0 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 On Thu, 31 Oct 2002, Alexander Kabaev wrote: > On Thu, 31 Oct 2002 12:20:14 -0500 (EST) > Daniel Eischen wrote: > > > I wonder how it works for Solaris (you can see both the non-underscore > > and single-underscore symbols resolve to the same thing)? Perhaps their > > stubs in libc pull the libgcc trick? > > Solaris libc uses something called ti_jmp_table to locate pthread symbols. > Both _pthread and pthread functions resolve to the same stub which does > something like this: > > 1) fetch a function pointer from the ti_jmp_table > 2) jump to it. > > By default, ti_jump_table entries contain pointers to dummy function like > _return_zero if no threading library is loaded. When the threading library is > loaded, ti_jump_table is populated with new pointers to functions implemented > in threading library library. GDB did not allow me to track down where exactly > this happens, I presume .init function in libpthread.so does that. OK, here's a patch that uses a jump table, as well as some other fixes (use single underscore versions of pthread functions internally in libc_r, avoid cancellation points for _pthread_cond_[timed]wait, and other cleanups): http://people.freebsd.org/~deischen/libc-libc_r.diffs Can someone review and test this with GNOME? -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message