From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 345 invoked by alias); 20 Jun 2002 17:30:40 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 319 invoked from network); 20 Jun 2002 17:30:36 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 20 Jun 2002 17:30:36 -0000 Received: from porcupine.cygnus.com (romulus.sfbay.redhat.com [172.16.27.251]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA06078 for ; Thu, 20 Jun 2002 10:30:34 -0700 (PDT) Received: from porcupine.cygnus.com (IDENT:3Ds44WrbMMJq5GZCOHqquOTx1+I8Ljmg@localhost.localdomain [127.0.0.1]) by porcupine.cygnus.com (8.12.2/8.12.2) with ESMTP id g5KHY4bA025301; Thu, 20 Jun 2002 11:34:05 -0600 Received: from porcupine.cygnus.com (law@localhost) by porcupine.cygnus.com (8.12.2/8.12.2/Submit) with ESMTP id g5KHY2lX025297; Thu, 20 Jun 2002 11:34:03 -0600 To: "Ed Harcourt" cc: gcc-help@gcc.gnu.org Subject: Re: g++ 2.95.2 on HP-UX 11: __do_global_ctors() not getting called? Reply-To: law@redhat.com From: law@redhat.com In-reply-to: Your message of Thu, 20 Jun 2002 13:22:05 EDT. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jun 2002 10:30:00 -0000 Message-ID: <25296.1024594441@porcupine.cygnus.com> X-SW-Source: 2002-06/txt/msg00190.txt.bz2 In message , "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