Re: dlopen() problem

From: Andrew Gierth (andrew_at_erlenstar.demon.co.uk)
Date: 05/31/03


Date: 31 May 2003 06:34:53 +0100


>>>>> "one2001boy" == one2001boy@yahoo com <one2001boy@yahoo.com> writes:

 one2001boy> Hello,
 one2001boy> I just find a problem with dlopen(). Any help is
 one2001boy> appreciated.

 one2001boy> If I have C function func1() and func2(), func2() will
 one2001boy> call func1(), both func1() and func2() are built as
 one2001boy> shared library dllib.so.

 one2001boy> I have another program called "prog", it contains the
 one2001boy> same func1() name but different definition from func1()
 one2001boy> in dllib.so, "prog" wants to load dllib.so with dlopen()
 one2001boy> and call func2(), it is expected that func2() should call
 one2001boy> func1() inside dllib.so, not inside prog. But, func2()
 one2001boy> calls func1() inside prog instead of inside dllib.so.

 one2001boy> How to make sure func2() call func1() inside dllib.do?

you don't mention what platform, but linking the .so with -Bsymbolic
might be what you need.

-- 
Andrew.
comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>


Relevant Pages