Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jan 2001 12:03:02 -0600
From:      "Jacques A. Vidrine" <n@nectar.com>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        arch@freebsd.org, jdp@polstra.com
Subject:   other approach for hiding names (was Re: Request For Review: libc/libc_r changes to allow -lc_r)
Message-ID:  <20010122120302.A93660@hamlet.nectar.com>
In-Reply-To: <Pine.SUN.3.91.1010120171614.8403A-100000@pcnet1.pcnet.com>; from eischen@vigrid.com on Sat, Jan 20, 2001 at 05:26:26PM -0500
References:  <20010120153158.A88123@hamlet.nectar.com> <Pine.SUN.3.91.1010120171614.8403A-100000@pcnet1.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
[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!]
 
On Sat, Jan 20, 2001 at 05:26:26PM -0500, Daniel Eischen wrote:
> Sorry, I don't think that's going to work, especially for
> sigaction, flock, and kevent.  These cannot be #define'd to
> there underscore(_) equivalents because it would also redefine
> struct sigaction, struct flock, and struct kevent.

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'

If we had such a thing, then we wouldn't have to phuk around with the
preprocessor and maul the source tree.  All there would be to maintain
would be a list of symbols that we want to be left unmangled (or the
converse -- I'm not sure which serves better).

Cheers,
-- 
Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org

[1] Actually this list would probably be all ISO C names + other
    symbols that require special handling for threads.  Or whatever.
  


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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