Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 May 2003 17:53:16 +0200 (CEST)
From:      Harti Brandt <brandt@fokus.fraunhofer.de>
To:        "Jacques A. Vidrine" <nectar@FreeBSD.org>
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: `Hiding' libc symbols
Message-ID:  <20030506175017.C631@beagle.fokus.fraunhofer.de>
In-Reply-To: <20030506152605.GE77708@madman.celabo.org>
References:  <20030501182820.GA53641@madman.celabo.org> <20030505110601.H53365@beagle.fokus.fraunhofer.de> <3EB7CC73.9C61C27E@mindspring.com> <20030506152605.GE77708@madman.celabo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030506175017.C631>