From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23895 invoked by alias); 3 Oct 2012 13:47:15 -0000 Received: (qmail 23803 invoked by uid 48); 3 Oct 2012 13:46:47 -0000 From: "dje at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/54791] AIX-only: Constructors are not called in main program. Date: Wed, 03 Oct 2012 13:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: dje at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg00204.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54791 --- Comment #2 from David Edelsohn 2012-10-03 13:46:44 UTC --- Constructors are working because they work without your big header. I would try using divide and conquer techniques to reduce the big header and find out what is interfering with constructors. It gives all appearances that it is due to the user code. Static constructors and destructors are run by functions generated at link time. A programmer wrapper around AIX ld called "collect2" scans object files and libraries for constructors and generates functions that are invoked by AIX linker -binitfini feature. You can add -Wl,-debug to the link line to see the way the AIX linker is invoked and see the helper function. Is something in the big header changing the mangled names of constructors and destructors so that they do not use the standard pattern? Or inserting some illegal character like dollar sign ($)?