From owner-freebsd-threads@FreeBSD.ORG Fri Jun 20 13:59:47 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E3CDA37B401 for ; Fri, 20 Jun 2003 13:59:47 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB74043FE0 for ; Fri, 20 Jun 2003 13:59:45 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5KKxjDZ077959; Fri, 20 Jun 2003 13:59:45 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5KKxjR8019249; Fri, 20 Jun 2003 13:59:45 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h5KKxjLI019248; Fri, 20 Jun 2003 13:59:45 -0700 (PDT) (envelope-from marcel) Date: Fri, 20 Jun 2003 13:59:45 -0700 From: Marcel Moolenaar To: Daniel Eischen Message-ID: <20030620205945.GA19212@dhcp01.pn.xcllnt.net> References: <20030620204314.GA19111@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: TLS: defining the problem space X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2003 20:59:48 -0000 On Fri, Jun 20, 2003 at 04:50:45PM -0400, Daniel Eischen wrote: > On Fri, 20 Jun 2003, Marcel Moolenaar wrote: > > If pthread defines __tls_get_addr() in complete executables and RTLD > > defines __tls_get_addr() in shared executables, we have duplicate > > definitions for shared executables, with pthread (using dynamic TLS). > > Which takes precedence? [answer: RTLD] > > You can have one __tls_get_addr() be a weak definition, and > lib{thr,pthread,c_r} can define a non-weak definition. Of course. The intend of the question was not to ask how, merely to ask which. The answer is not simple, because what if we also have a (weak) definition in libc to deal with the complete, without pthread and dynamic TLS case (if we want to support that)? Then we have 3 definitions. If both libc and pthread provide weak definitions, then how do we guarantee correct binding in the complete, with pthread and dynamic TLS case. If libc and RTLD provide weak definitions, then how do we guarantee proper binding in the shared, without pthread and dynamic TLS case? That's my point of having the problem space defined: we have a lot of cases to cover and I want it nailed down and documented before we do anything else. > BTW, we can probably drop libc_r from the picture (mark it > for deprecation). Yay! :-) -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net