I got one very succinct response from Casper Dik <casper@holland.Sun.COM>.
The original request:
>I am trying to generate an object file suitable for loading into
>another program using dlopen(). It has numerous functions in it
>which must remain hidden to the outside world. Only one function
>should be visible externally; it will be used to access everything
>The ld man page says to use "-B reduce" or "-B local" to make
>everything local, and to use "-M mapfile" to specify those symbols
>which must remain global. It then points to the "Linker and Libraries
>manual" for instructions. This manual talks at length about using
>mapfiles, but never about how to specify global symbols with them.
> Here's an example:
> % cat mapfile
> local: *;
> Then link the library with:
> cc -M mapfile -G *.o -o lib.so
> and you'll only get foo bar baz as globals (and the builtin symbols).
> The "local: *" directive makes all symbols local. Global: lists the
David L. Markowitz Director, UNIX Software
David.Markowitz@litronic.com Litronic Industries
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:05 CDT