[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problems with dlopen()
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Problems with dlopen()
- From: jz_(_at_)_ob_(_dot_)_ml_(_dot_)_hp_(_dot_)_ux_(_dot_)_be
- Date: Sat, 16 Feb 2002 17:01:06 +0100 (MET)
Hello,
a program I want to compile with shared libraries enabled ahs
this C code in its config script:
#include <stdio.h>
#include <dlfcn.h>
int main (argc,argv)
int argc;
char * argv;
{
char * C;
void * handle = dlopen(LIBNAME,RTLD_NOW);
typedef char * myfunc();
myfunc * f_handle;
if (!handle)
exit(1);
f_handle = dlsym(handle,"myfunc");
if (!f_handle)
exit(1);
C = f_handle();
if (C &&
0 == strcmp(C,"succeed"))
exit(0);
dlclose(handle);
exit(1);
}
Changing RTLD_NOW to DL_LAZY as man page suggested does not help.
This test succeeds unchanged on my Linux 2.2 and Solaris 8
systems. Reportedly it succeeds on IRIX also.
Any suggestions?
Thanks.
jz
--
_
// ARMOR, n. The kind of clothing worn by a man
,-'',_..---. whose tailor is a blacksmith.
/ @ __%
`--_.. __( )@
(,_.'(,,_..' --Ambrose Bierce: The Devil's Dictionary
Visit your host, monkey.org