Exporting symbols for dlopen from shared library?

Marat Boshernitsan maratb@cs.berkeley.edu
Wed Apr 29 15:21:00 GMT 1998


Hi,

I am having the following problem with explicit loading of dynamic
libraries:

I am working on dynamic library that can be loaded into the JVM and
Tcl/Tk interpreter.  This library, say foo.so, needs to load another
dynamic library using dlopen, say bar.so.  The name of bar.so is not
determinable until runtime.  The problem is that bar.so relies on
certain symbols from foo.so that it cannot find when loaded with dlopen.

I was having exactly the same problem before, when foo.so was built as
an executable, but I managed to fix it by passing -export-dynamic to the
linker (-rdynamic to gcc on Linux).  Is there a similar compiler/linker
magic I can use to build foo.so?

Compiler egcs-1.0.2.
Linker GNU ld 2.9
Platforms Redhat Linux 5.0, Solaris 2.6.

Thanks in advance,

-- Marat




More information about the Gcc mailing list