Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Apr 2003 17:08:08 -0500
From:      "Jacques A. Vidrine" <nectar@FreeBSD.org>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        cvs-all@FreeBSD.org
Subject:   hiding symbols in libc (was Re: cvs commit: src/lib/libc/gen ...)
Message-ID:  <20030429220808.GB18743@madman.celabo.org>
In-Reply-To: <xzp65oxrn3e.fsf@flood.ping.uio.no>
References:  <200304292113.h3TLDoGF072965@repoman.freebsd.org> <xzp65oxrn3e.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Apr 29, 2003 at 11:49:09PM +0200, Dag-Erling Smorgrav wrote:
> Jacques Vidrine <nectar@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@celabo.org . jvidrine@verio.net . nectar@freebsd.org . nectar@kth.se



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