Subject: Re: dlopen() status
To: James Macnicol <>
From: Todd Vierling <>
List: port-alpha
Date: 01/05/2001 18:43:20
On Sat, 6 Jan 2001, James Macnicol wrote:

: dlsym(RTLD_DEFAULT, symname);
: (to get the address of a function defined in the program, or more likely, one
: of the shared libs. that has been loaded via. dlopen() at runtime).  This
: doesn't appear to be possible (no definition in dlfcn.h).  I have tried
: substituting NULL for RTLD_DEFAULT (the only obvious thing I can think of)
: but dlsym() is returning NULL for things it should be able to find.

If it's in the main program, you will need to link your program with the

cc ... -Wl,-E

(or more verbosely,)

cc ... -Wl,--export-dynamic

Without this, the shared symbol table of the resultant executable will not

-- Todd Vierling <>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --