From owner-cvs-src@FreeBSD.ORG Tue Apr 29 15:08:10 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A79B437B401; Tue, 29 Apr 2003 15:08:10 -0700 (PDT) Received: from gw.nectar.cc (gw.nectar.cc [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB67D43FBD; Tue, 29 Apr 2003 15:08:09 -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 5E77A69; Tue, 29 Apr 2003 17:08:09 -0500 (CDT) Received: by madman.celabo.org (Postfix, from userid 1001) id 923D978C4A; Tue, 29 Apr 2003 17:08:08 -0500 (CDT) Date: Tue, 29 Apr 2003 17:08:08 -0500 From: "Jacques A. Vidrine" To: Dag-Erling Smorgrav Message-ID: <20030429220808.GB18743@madman.celabo.org> References: <200304292113.h3TLDoGF072965@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.3i-ja.1 cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: hiding symbols in libc (was Re: cvs commit: src/lib/libc/gen ...) X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2003 22:08:11 -0000 On Tue, Apr 29, 2003 at 11:49:09PM +0200, Dag-Erling Smorgrav wrote: > Jacques Vidrine 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