From owner-freebsd-arch Tue Jan 23 11:57: 0 2001 Delivered-To: freebsd-arch@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 4F88537B400 for ; Tue, 23 Jan 2001 11:56:42 -0800 (PST) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.1/8.11.1) with ESMTP id f0NJuIj05190; Tue, 23 Jan 2001 11:56:18 -0800 (PST) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.1/8.11.0) id f0NJuDW24253; Tue, 23 Jan 2001 11:56:13 -0800 (PST) (envelope-from jdp) Date: Tue, 23 Jan 2001 11:56:13 -0800 (PST) Message-Id: <200101231956.f0NJuDW24253@vashon.polstra.com> To: arch@freebsd.org From: John Polstra Reply-To: arch@freebsd.org Cc: n@nectar.com Subject: Re: other approach for hiding names (was Re: Request For Review: libc/libc_r changes to allow -lc_r) In-Reply-To: <20010122120302.A93660@hamlet.nectar.com> References: <20010120153158.A88123@hamlet.nectar.com> <20010122120302.A93660@hamlet.nectar.com> Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <20010122120302.A93660@hamlet.nectar.com>, Jacques A. Vidrine wrote: > [I cc'd: jdp directly because he's the person most knowledgeable about > linker issues with which I've corresponded. Hope you don't mind, > John!] No problem, but next time please use "bcc". Once you get on the cc list it's impossible to get off of it again. > I'm beginning to think that the pre-processor is the wrong tool for > the job. It can't tell a function or object declaration from other > tokens. > > Is there somewhere in the build process that we could insert a tool > that does something like the following? > > for each externally visible symbol: > skip symbol if it is reserved (e.g. '_[A-Z_]') > skip symbol if it is not on the ISO C name list [1] > if the symbol is defined in this module: > rename 'symbol' to '__symbol' > add weak reference for 'symbol' -> '__symbol' > else (the symbol is an undefined reference): > rename 'symbol' to '__symbol' I'm really leery of introducing a special tool for this. I think it could cause problems with upgrading from older versions, and would make us needlessly and confusingly different from the other BSDs. Also I think it's a lot clearer to be able to see what is going on by looking at the source files, without having to remember the magic going on behind the scenes. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message