hiding symbols in libc (was Re: cvs commit: src/lib/libc/gen ...)

Jacques A. Vidrine nectar at FreeBSD.org
Tue Apr 29 15:08:11 PDT 2003


On Tue, Apr 29, 2003 at 11:49:09PM +0200, Dag-Erling Smorgrav wrote:
> Jacques Vidrine <nectar at FreeBSD.org> writes:
> >   Log:
> >   `Hide' strlcpy and strlcat (using the namespace.h / __weak_reference
> >   technique) so that we don't wind up calling into an application's
> >   version if the application defines them.
> 
> We should probably do this for every libc function that is used within
> libc...

Yes we should.  But I don't care for this technique, because it makes
libc look like it is not written in C :-) (Underscores for practically
all function calls.)  Unfortunately, I do not know of a better way to
do this at the source-code level.  A couple of years ago I suggested
post-processing the object files to automatically hide the symbols
(all of them, or at least the non-ISO C and non-POSIX ones) à la
objcopy, but I seem to recall that was shot down.   (Hrm, I cannot
now find the thread via Google.)

Cheers,
-- 
Jacques Vidrine   . NTT/Verio SME      . FreeBSD UNIX       . Heimdal
nectar at celabo.org . jvidrine at verio.net . nectar at freebsd.org . nectar at kth.se


More information about the cvs-src mailing list