[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dlsym() and C++



Magnus Norddahl wrote:

> It doesn't solve my real problem with dynamic linking - I guess I'll just
> have to keep on playing around with my coredumper prog until it actually
> does provoke the dynamic linker!

Why are you attempting to use dlopen() to access libMesaGLU.so? These
libraries are generally intended to be used with an -l flag on the
linker's command line. Part of ld's function is to resolve all the
externals to libraries as they are needed. ld may have no way of
determining whether or not MesaGLU is dependent upon MesaGL. Libraries
are often not linked against one another as one would expect.

Maybe if you did a dlopen on libMesaGL.so with the flags RTLD_NOW and
RTLD_GLOBAL before opening libMesaGLU.so, it would resolve properly.
RTLD_NOW resolves all external symbols immediately. RTLD_GLOBAL makes
those symbols visible to other shared libs that may be loaded.

Hope this helps :)
-- 
----------------------------------------------------------------------
Jeff Read <bitwize@geocities.com>/ http://genpc.home.ml.org
Unix / Linux / Windows Hacker,  / Boycott Microsoft!
Anime & Sonic Fan,             / Use Linux/GNU!
All Around Nice Guy           / Let's keep the Net and the Land FREE!
----------------------------------------------------------------------