From owner-freebsd-arch@FreeBSD.ORG Wed Jan 7 04:01:38 2015 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22076F91; Wed, 7 Jan 2015 04:01:38 +0000 (UTC) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.netplex.net", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6DE01CE8; Wed, 7 Jan 2015 04:01:37 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.9/8.14.9/NETPLEX) with ESMTP id t0741UUR064895; Tue, 6 Jan 2015 23:01:30 -0500 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Tue, 06 Jan 2015 23:01:30 -0500 (EST) Date: Tue, 6 Jan 2015 23:01:30 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net Reply-To: Daniel Eischen To: Konstantin Belousov Subject: Re: Fixing dlopen("libpthread.so") In-Reply-To: <20150107032941.GJ42409@kib.kiev.ua> Message-ID: References: <20141226165337.GJ1754@kib.kiev.ua> <20150103212837.GC46373@stack.nl> <20150104114600.GC42409@kib.kiev.ua> <20150104182026.GA61250@stack.nl> <20150105023708.GD42409@kib.kiev.ua> <20150106205046.GA24971@stack.nl> <20150107032941.GJ42409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: threads@freebsd.org, Jilles Tjoelker , arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jan 2015 04:01:38 -0000 On Wed, 7 Jan 2015, Konstantin Belousov wrote: > On Tue, Jan 06, 2015 at 09:50:46PM +0100, Jilles Tjoelker wrote: >> On Mon, Jan 05, 2015 at 04:37:08AM +0200, Konstantin Belousov wrote: >>> Next natural question is about the __error calls through PLT in the >>> .cerror asm. Before the work was committed, libthr interposed __error, >>> which was required for correct operation. Now, we need __error exported, >>> but do we need support its interposing ? This is an implementation >>> detail for errno, I do not see any loss from not allowing to override >>> errno location. >> >> Indeed, there is no need to allow interposing __error (as with many >> libc-internal calls to its exported symbols). Additionally, the current >> namespace.h mechanism could be used to redirect __error calls from C >> code. >> >> Glibc uses macro trickery with the asm labels compiler feature, making >> libc code see things like >> int *__error(void) asm("__hidden__error"); >> and defining the hidden alias somewhere. This also works for >> compiler-generated calls like to memcpy(). I'm not sure whether it is a >> good idea to add this extra trickery and depend on the compiler feature. > I might look at this after the current change is committed. I don't quite follow all the above about __error(), but non-C programs need to interface to an __error() that works regardless of threading or not. -- DE