From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11133 invoked by alias); 19 Mar 2012 20:35:16 -0000 Received: (qmail 11091 invoked by uid 22791); 19 Mar 2012 20:35:14 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Mar 2012 20:34:50 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2JKYodm016078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Mar 2012 16:34:50 -0400 Received: from greed.delorie.com ([10.3.113.18]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q2JKYnru012841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Mar 2012 16:34:50 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.14.4/8.14.4) with ESMTP id q2JKYnBw022646; Mon, 19 Mar 2012 16:34:49 -0400 Received: (from dj@localhost) by greed.delorie.com (8.14.4/8.14.4/Submit) id q2JKYmPa022645; Mon, 19 Mar 2012 16:34:48 -0400 Date: Mon, 19 Mar 2012 20:35:00 -0000 Message-Id: <201203192034.q2JKYmPa022645@greed.delorie.com> From: DJ Delorie To: "H.J. Lu" CC: jakub@redhat.com, gcc-patches@gcc.gnu.org In-reply-to: (hjl.tools@gmail.com) Subject: Re: PING: PATCH: PR target/46770: Use .init_array/.fini_array sections References: <20110722123042.GB2687@tyan-ft48-01.lab.bos.redhat.com> <20110819081733.GB2687@tyan-ft48-01.lab.bos.redhat.com> <20110819145522.GF2687@tyan-ft48-01.lab.bos.redhat.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-03/txt/msg01308.txt.bz2 This breaks constructors on pretty much every elf+newlib target, because newlib and gcc both use HAVE_INITFINI_ARRAY (and have for many years) but the tests don't match. GCC puts ctors in .ctors but libgcc is built without support for them (newlib's generated config headers define HAVE_INITFINI_ARRAY, which causes gcc's initini-array.h to set USE_INITFINI_ARRAY, which shuts off libgcc's ctor/dtor support), so they don't run. > 2011-08-20 H.J. Lu > > PR target/46770 > * config.gcc (tm_file): Add initfini-array.h if > .init_arrary/.fini_array are supported. > > * crtstuff.c: Don't generate .ctors nor .dtors sections if > USE_INITFINI_ARRAY is defined. > > * output.h (default_elf_init_array_asm_out_constructor): New. > (default_elf_fini_array_asm_out_destructor): Likewise. > * varasm.c (elf_init_array_section): Likewise. > (elf_fini_array_section): Likewise. > (get_elf_initfini_array_priority_section): Likewise. > (default_elf_init_array_asm_out_constructor): Likewise. > (default_elf_fini_array_asm_out_destructor): Likewise. > > * config/initfini-array.h: New.