This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: g++ 2.95.2 on HP-UX 11: __do_global_ctors() not getting called?
- From: law at redhat dot com
- To: "Ed Harcourt" <harcourt at cadence dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 20 Jun 2002 11:34:01 -0600
- Subject: Re: g++ 2.95.2 on HP-UX 11: __do_global_ctors() not getting called?
- Reply-to: law at redhat dot com
In message <B64C24D6DF7BF040BAF59B923D06180B990096@exmbx01chel.global.cadence.c
om>, "Ed Harcourt" writes:
> I have a C++ shared library built using g++ 2.95.2 on HP-UX 11. The library
> linked using the HP-UX linker not the GNU linker. The library gets
> dynamically loaded with a call to shl_load(). When the library is loaded
> nonlocal static initializations don't get executed. In fact I noticed that
> if I link in the shared library statically then I can see a call stack that
> includes some rather important sounding functions like __main() and
> __do_global_ctors(). But if this library dynamically loaded using shl_load
> then these functions don't seem to get called.
You have to use shl_findsym to get a pointer to the shared library
initializer routine and call it yourself.
jeff