From owner-freebsd-arch@FreeBSD.ORG Tue May 6 22:52:09 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 A6B4B37B401 for ; Tue, 6 May 2003 22:52:09 -0700 (PDT) Received: from puffin.mail.pas.earthlink.net (puffin.mail.pas.earthlink.net [207.217.120.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id F215D43F85 for ; Tue, 6 May 2003 22:52:08 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0555.cvx40-bradley.dialup.earthlink.net ([216.244.44.45] helo=mindspring.com) by puffin.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19DHpw-0001l8-00; Tue, 06 May 2003 22:51:29 -0700 Message-ID: <3EB89E8C.FD00B065@mindspring.com> Date: Tue, 06 May 2003 22:50:04 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Dag-Erling Smorgrav References: <20030501182820.GA53641@madman.celabo.org> <20030501191027.GA53801@madman.celabo.org> <20030505110601.H53365@beagle.fokus.fraunhofer.de> <20030505175426.GA19352@madman.celabo.org> <20030505205051.GA40572@nagual.pp.ru> <20030505231135.GA21953@madman.celabo.org> <20030505231837.GA44533@nagual.pp.ru> <20030506170823.GI83663@lucky.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4397de1aea7b5b86652c9b1477b1247d8350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: "Andrey A. Chernov" 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: Wed, 07 May 2003 05:52:09 -0000 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. Technically, this is not true. However, tiered dependencies will still enable this to break (A(standard 1) depends on lib containing B(standard 1+) depends on libc(standard 1++)). Other than that, you could, using an ELF section, attribute the object files by the standards which were in effect when they were compiled, and do one heck of a lot of work in the linker and with symbol decoration to deal with this. This can be made to work with #pragma, if you are using a compiler with an external preprocessor. In effect, this is what Linux does, when it versions it's ABI in the current glibc ABI, and in its kernel modules symbol stuff. Its why I object so strongly to changing FreeBSD to do the same thing, even though there are clever tricks you can do if you have it. Doing this would be almost incredibly painful, since it would involve namespace attributed symbols, and import and export lists. But it's *possible*. -- Terry