From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13166 invoked by alias); 22 Apr 2012 08:03:07 -0000 Received: (qmail 13149 invoked by uid 22791); 22 Apr 2012 08:03:06 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Apr 2012 08:02:54 +0000 From: "igodard at pacbell dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/46770] Replace .ctors/.dtors with .init_array/.fini_array on targets supporting them Date: Sun, 22 Apr 2012 08:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: igodard at pacbell dot net X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hjl.tools at gmail dot com X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: CC 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-04/txt/msg01815.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770 Ivan Godard changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |igodard at pacbell dot net --- Comment #96 from Ivan Godard 2012-04-22 08:01:55 UTC --- I'm a user that the switch to init_array just broke. Details are in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53068, but to summarize: Large production environment Must use other compilers too Third party binaries as well as our code. Each project represented as a .a library. Static initialization dependencies between TUs in a project (and hence within .o's in a library). Static initialization dependencies among projects. Executables link some explicit .o's with libraries from other projects, and must provide semantically correct ordering. Hence: Can't use priorities (not supported on other compilers; can't add pragmas to 3rd party code; maintaining a global absolute order over hundreds of files that change dependencies each release is a headache) Can't use init_array (no way to control ordering among files extracted from a single library) So for a decade we have manually maintained a dependency graph (relative, not absolute like priorities) and used that to put explicit commands to position .ctor sections into a linker script. That broke in 4.7. Yes, the language leaves inter-TU order unspecified. But we the users have to control that particular unspecified to get our job done. There used to be a way to exercise that control, through hooks in the linker script. You have now gratuitously taken away that control *and left nothing else to use instead*. At this point our choices appear to be to stay at 4.6 forever (or at least until the roar of complaint makes you do something), or to do our own collect2. Pretty poor.