From owner-freebsd-arch@FreeBSD.ORG Tue May 6 12:07:50 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 8586C37B401 for ; Tue, 6 May 2003 12:07:50 -0700 (PDT) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4066E43F93 for ; Tue, 6 May 2003 12:07:49 -0700 (PDT) (envelope-from ache@pobrecita.freebsd.ru) Received: from pobrecita.freebsd.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.12.9/8.12.9) with ESMTP id h46J7lrO059451; Tue, 6 May 2003 23:07:48 +0400 (MSD) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.9/8.12.9/Submit) id h46J7lm6059450; Tue, 6 May 2003 23:07:47 +0400 (MSD) Date: Tue, 6 May 2003 23:07:47 +0400 From: "Andrey A. Chernov" To: Dag-Erling Smorgrav Message-ID: <20030506190747.GA59160@nagual.pp.ru> References: <20030505175426.GA19352@madman.celabo.org> <20030505205051.GA40572@nagual.pp.ru> <20030505231135.GA21953@madman.celabo.org> <20030505231837.GA44533@nagual.pp.ru> <20030506170823.GI83663@lucky.net> <20030506182756.GA57720@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i 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 19:07:50 -0000 On Tue, May 06, 2003 at 20:40:35 +0200, Dag-Erling Smorgrav wrote: > "Andrey A. Chernov" writes: > > On Tue, May 06, 2003 at 19:56:27 +0200, Dag-Erling Smorgrav wrote: > >> - If you stayed awake through the previous paragraph you should by > >> now have concluded that it simply is not possible for the linker to > >> enforce namespaces like Andrey wants it to, because a) the linker > >> can't know what headers were included; b) the exact set of reserved > >> names can vary from compilation unit to compilation unit within the > >> same application and c) namespace issues affect portions of the > >> code which are outside the linker's purview (such as the names of > >> function arguments and static or automatic variables). Namespaces > >> are a source code issue and cannot be handled anywhere but at the > >> source code level. > > There is no problem. Each *.h function prototype can be accompanied with > > some assembler instruction making it strong reference. The same thing can > > be conditionalized at the header level using _POSIX_SOURCE or other > > defines. So, linker will know, what headers are included. > > I would like to draw your attention to points b) and c) above and ask > how you plan to address them. About b), I don't quite understand, what you mean. If inside the same application some file includes, say, math.h and use sin() and another file not includes math.h and defines its own sin() it is error. About c), at this moment we discuss functions namespace only, i.e. linker "T" class.