From owner-freebsd-arch@FreeBSD.ORG Tue May 6 08:53:19 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 8B28E37B401; Tue, 6 May 2003 08:53:19 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C50343FA3; Tue, 6 May 2003 08:53:18 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h46FrGE26330; Tue, 6 May 2003 17:53:16 +0200 (MEST) Date: Tue, 6 May 2003 17:53:16 +0200 (CEST) From: Harti Brandt To: "Jacques A. Vidrine" In-Reply-To: <20030506152605.GE77708@madman.celabo.org> Message-ID: <20030506175017.C631@beagle.fokus.fraunhofer.de> References: <20030501182820.GA53641@madman.celabo.org> <20030505110601.H53365@beagle.fokus.fraunhofer.de> <3EB7CC73.9C61C27E@mindspring.com> <20030506152605.GE77708@madman.celabo.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: Tue, 06 May 2003 15:53:19 -0000 On Tue, 6 May 2003, Jacques A. Vidrine wrote: JAV>On Tue, May 06, 2003 at 05:14:28PM +0200, Harti Brandt wrote: JAV>> I have checked with the ISO-C draft I have around here. From a principal JAV>> point of view, we are allowed to disable the redefinition of C-library JAV>> functions. The question is, what does it help us and what do we loose: JAV>> JAV>> It helps us to catch one particular kind of bugs in 3rd party software, JAV>> where the software has a buggy implementation (in the context of our own JAV>> implementation) of a standard function. This also rules actually non-buggy JAV>> implementations of functions that adhere to newer standards than our own JAV>> implementations. This means that in order to actually help we have to go JAV>> through each instance of a port redefining a libc function and decide, JAV>> whether it is buggy, the same as our implementation or simply more JAV>> featureful and whether it is compatible with our implementation. JAV>> JAV>> We loose the ability to do certain well known tricks (which have worked JAV>> since C was invented), most of which help in debugging (f.e. replacing JAV>> malloc or str* for range checking) and we make the porting of several JAV>> software packages to FreeBSD actually harder. JAV> JAV>For these reasons and others, I cannot support any attempt to make JAV>it impossible for a programmer to define his/her own symbols that JAV>conflict with the [foo] Standard. JAV> JAV>Or stated more agressively, the day the FreeBSD toolchain refuses JAV>to allow me to define my own version of strlcpy _for use by my JAV>application_ is the day I find another development platform. So if you 'hide' all the libc symbols you will to exactly that. I can, of course then define _malloc() instead of malloc(), but that is just another case in the ever growing incompatibility between unices. JAV>If I can create code to override the internal libc strlcpy, too, JAV>that's just a plus. (Note we have this today even with `hidden' JAV>symbols.) We have that if you happen to be a toolchain/libc expert, that knows, that magically the linker does not do what it has done for decades - using the first definition of a symbol for ALL following references and that you have to prepend an underscore to work around this. harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org