Hi,
On Wed, 9 Aug 2000, Allen Unueco wrote:
> I need the ability to limit the dynamic symbols of a shared lib.
>
> The method (on Linux) I was using before was this:
> gcc -g -uR -shared -Xlinker --version-script -Xlinker foo.mapfile -o
> foo.so foo.o
>
> I've tried this but it only limits the 'normal' symbols:
> libfoo_la_LDFLAGS = -module -export-symbols foo.sym
>
> nm --dynamic libfoo.so
> still shows all the symbols and my program doesn't behave.
Yes, this is a problem of libtool on linux, in that on that platform
-export-symbols is implemented not with a linker script (as on
e.g. Solaris), but instead with the GNU linkers --retain-symbols-file
option, which does only limit the normal, but not the dynamic symbols
(which I would consider a bug in ld).
On KDE we have a similar problem. I guess, you would need libtool option
to directly pass a option to the linker (it's -Wl,... or -Xlinker
... IIRC).
> Something like;
> -export-dynamic-symbols SYMFILE
> is what I'm looking for.
You could also implement the current Solaris behaviour on Linux. You would
have to change the definition of $archive_expsym_cmds in ltcf-cxx.sh (in
case you use the multi-language branch of libtool).
Ciao,
Michael.