public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* g++ 2.95.2 on HP-UX 11: __do_global_ctors() not getting called?
@ 2002-06-20 10:22 Ed Harcourt
  2002-06-20 10:30 ` law
  0 siblings, 1 reply; 2+ messages in thread
From: Ed Harcourt @ 2002-06-20 10:22 UTC (permalink / raw)
  To: gcc-help

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.

Any ideas?

Thanks in advance.

Ed

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: g++ 2.95.2 on HP-UX 11: __do_global_ctors() not getting called?
  2002-06-20 10:22 g++ 2.95.2 on HP-UX 11: __do_global_ctors() not getting called? Ed Harcourt
@ 2002-06-20 10:30 ` law
  0 siblings, 0 replies; 2+ messages in thread
From: law @ 2002-06-20 10:30 UTC (permalink / raw)
  To: Ed Harcourt; +Cc: gcc-help

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-20 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-20 10:22 g++ 2.95.2 on HP-UX 11: __do_global_ctors() not getting called? Ed Harcourt
2002-06-20 10:30 ` law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).