[Top][All Lists]

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

dlopen(): unresolved symbols for C++ initializers

From: Gustavo Niemeyer
Subject: dlopen(): unresolved symbols for C++ initializers
Date: Thu, 28 Dec 2000 15:38:07 -0200
User-agent: Mutt/1.2.5i

Hi there!!

I'm currently working on a project that dlopen()s modules
that have static C++ objects inside (with RTLD_GLOBAL). One
of these object's constructors tries to dlopen() another
shared object. The shared object has references to symbols
in its parent module. When the program is called this way
it fails, with an "unresolved symbol" error. If we move the
code that dlopen() outside of the static object's constructor,
everything works.

I wrote some simplified code to test this (attached).

The static object is called "master". When the constructor is
called with 1 as its parameter, it runs dlopen() from the
constructor, and it fails. If called with 0, it runs at a later
stage, and it succeeds.

This is the error:

$ ./main
./slave_c.so: undefined symbol: hello_world
./slave_cc.so: undefined symbol: hello_world

Anyone know what the problem is?

Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]

Attachment: bug.tar.gz
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]