From owner-freebsd-hackers Sat Oct 4 11:43:22 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA00442 for hackers-outgoing; Sat, 4 Oct 1997 11:43:22 -0700 (PDT) Received: from srv.net (snake.srv.net [199.104.81.3]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA00427; Sat, 4 Oct 1997 11:42:19 -0700 (PDT) Received: from darkstar.home (dialin1.anlw.anl.gov [141.221.254.101]) by srv.net (8.8.5/8.8.5) with SMTP id MAA26286; Sat, 4 Oct 1997 12:42:05 -0600 (MDT) Date: Sat, 4 Oct 1997 11:41:26 -0700 (MST) From: Charles Mott X-Sender: cmott@darkstar.home To: freebsd-hackers@freebsd.org cc: ari@suutari.iki.fi, brian@freebsd.org Subject: link tables and scope Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I have a question regarding linker tables created for libraries. In the packet aliasing library (libalias) used by ppp and natd, there are two header files in the source, alias.h and alias_local.h. The first contains "public" interfaces and the second is basically a set of function prototypes used between different modules within the library source, but not intended for public access. What I observe is that the link symbol table (I don't know a better word for it), contains function names both in alias.h and alias_local.h. Is there any way to somehow restrict the scope of some globals in a library so that they cannot be linked by modules outside the library. The only way I know to do this is put the entire library in a single file and make as much as possible static. Charles Mott