From owner-freebsd-arch@FreeBSD.ORG Thu May 1 08:22:53 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 94FFA37B401 for ; Thu, 1 May 2003 08:22:53 -0700 (PDT) Received: from gw.nectar.cc (gw.nectar.cc [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id B330B43F75 for ; Thu, 1 May 2003 08:22:52 -0700 (PDT) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.nectar.cc (Postfix) with ESMTP id 25C0D50; Thu, 1 May 2003 10:22:52 -0500 (CDT) Received: by madman.celabo.org (Postfix, from userid 1001) id 6BC3478C4A; Thu, 1 May 2003 10:22:51 -0500 (CDT) Date: Thu, 1 May 2003 10:22:51 -0500 From: "Jacques A. Vidrine" To: "Andrey A. Chernov" Message-ID: <20030501152251.GB34992@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , "Andrey A. Chernov" , freebsd-arch@FreeBSD.org References: <20030430062647.GA82023@rot13.obsecurity.org> <20030430143121.GK39658@survey.codeburst.net> <20030430152708.GA26216@madman.celabo.org> <20030430153645.GL39658@survey.codeburst.net> <20030430164135.GB26508@madman.celabo.org> <20030501140255.GB1869@survey.codeburst.net> <20030501143032.GA34163@madman.celabo.org> <20030501144600.GC1869@survey.codeburst.net> <20030501145345.GA34884@madman.celabo.org> <20030501151458.GA54182@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030501151458.GA54182@nagual.pp.ru> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.3i-ja.1 cc: freebsd-arch@FreeBSD.org Subject: Re: `Hiding' libc symbols X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 15:22:53 -0000 On Thu, May 01, 2003 at 07:15:01PM +0400, Andrey A. Chernov wrote: > On Thu, May 01, 2003 at 09:53:45 -0500, Jacques A. Vidrine wrote: > > > > A libc consumer (getpwent.c): > > 587 namesize = _strlcpy(&keybuf[1], name, sizeof(keybuf)-1); > > IMHO, it is bad hack at whole, and all namespace.h tricks should be > removed. > > The reason is quite simple. Yes, you can save libc this way, but what > happens, if application linked, say, with libc AND libncurses (insert any > other system library here)? libc will be saved, but libncurses will not. > It means, to be logically, you need to replace strlcpy with _strlcpy in > ALL FreeBSD libraries. Better way is stop doing half-singing - > half-dancing and produce linker error when application attempts to replace > any function in standard namespace. It automatically makes impossible > broken binary-only packages. > > So, I vote for namespace.h removing (i.e. all _ tricks). Who with me? I'm with you ... as long as: (a) We then post-process libraries (or object files) to automagically handle the symbols (all of them, or maybe just those not covered by some standard we pick in the case of libc). e.g. something such as objcopy --weaken ${.IMPSRC} ${.TARGET} but a bit more work. (b) We give Daniel and others working on threaded libraries a chance to discuss the special needs there. (That _is_ why namespace.h was originally created. We do need to handle stubs somehow; weak symbols alone are not enough.) (c) We do it after 5.1-RELEASE, and before 5.2-RELEASE; or we only do it in 6.x. (d) I don't have to do it all. Cheers, -- Jacques Vidrine . NTT/Verio SME . FreeBSD UNIX . Heimdal nectar@celabo.org . jvidrine@verio.net . nectar@freebsd.org . nectar@kth.se