From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18286 invoked by alias); 1 Jul 2011 14:12:10 -0000 Received: (qmail 18265 invoked by uid 22791); 1 Jul 2011 14:12:09 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Jul 2011 14:11:54 +0000 Received: by qyk38 with SMTP id 38so1987446qyk.20 for ; Fri, 01 Jul 2011 07:11:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.98.206 with SMTP id r14mr2657320qcn.18.1309529513051; Fri, 01 Jul 2011 07:11:53 -0700 (PDT) Received: by 10.229.214.83 with HTTP; Fri, 1 Jul 2011 07:11:52 -0700 (PDT) In-Reply-To: References: Date: Fri, 01 Jul 2011 14:12:00 -0000 Message-ID: Subject: Re: PING: PATCH: PR target/46770: Use .init_array/.fini_array sections From: "H.J. Lu" To: Ian Lance Taylor Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2011-07/txt/msg00040.txt.bz2 On Sun, Jun 19, 2011 at 11:39 AM, H.J. Lu wrote: > On Fri, Jun 3, 2011 at 5:51 AM, H.J. Lu wrote: >> On Fri, Jun 3, 2011 at 5:31 AM, Richard Guenther >> wrote: >>> On Fri, Jun 3, 2011 at 6:31 AM, H.J. Lu wrote: >>>> On Wed, May 18, 2011 at 8:57 AM, H.J. Lu wrote: >>>>> On Tue, Apr 26, 2011 at 6:05 AM, H.J. Lu wrote: >>>>>> On Thu, Mar 31, 2011 at 7:57 AM, H.J. Lu wrote: >>>>>>> On Mon, Mar 21, 2011 at 11:40 AM, H.J. Lu wro= te: >>>>>>>> On Mon, Mar 14, 2011 at 12:28 PM, H.J. Lu wr= ote: >>>>>>>>> On Thu, Jan 27, 2011 at 2:40 AM, Richard Guenther >>>>>>>>> wrote: >>>>>>>>>> On Thu, Jan 27, 2011 at 12:12 AM, H.J. Lu = wrote: >>>>>>>>>>> On Tue, Dec 14, 2010 at 05:20:48PM -0800, H.J. Lu wrote: >>>>>>>>>>>> This patch uses .init_array/.fini_array sections instead of >>>>>>>>>>>> .ctors/.dtors sections if mixing .init_array/.fini_array and >>>>>>>>>>>> .ctors/.dtors sections with init_priority works. >>>>>>>>>>>> >>>>>>>>>>>> It removes .ctors/.ctors sections from executables and DSOes, = which will >>>>>>>>>>>> remove one function call at startup time from each executable = and DSO. >>>>>>>>>>>> It should reduce image size and improve system startup time. >>>>>>>>>>>> >>>>>>>>>>>> If a platform with a working .init_array/.fini_array support n= eeds a >>>>>>>>>>>> different .init_array/.fini_array implementation, it can set >>>>>>>>>>>> use_initfini_array to no. >>>>>>>>>>>> >>>>>>>>>>>> Since .init_array/.fini_array is a target feature. --enable-in= itfini-array >>>>>>>>>>>> is default to no unless the native run-time test is passed. >>>>>>>>>>>> >>>>>>>>>>>> To pass the native run-time test, a linker with SORT_BY_INIT_P= RIORITY >>>>>>>>>>>> support is required. =A0The binutils patch is available at >>>>>>>>>>>> >>>>>>>>>>>> http://sourceware.org/ml/binutils/2010-12/msg00466.html >>>>>>>>>>> >>>>>>>>>>> Linker patch has been checked in. >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> This patch passed 32bit/64bit regression test on Linux/x86-64.= =A0Any >>>>>>>>>>>> comments? >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> This updated patch fixes build on Linux/ia64 and should work on= others. >>>>>>>>>>> Any comments? >>>>>>>>>> >>>>>>>>>> Yes. =A0This is stage1 material. >>>>>>>>>> >>>>>>>>> >>>>>>>>> Here is the updated patch. =A0OK for trunk? >>>>>>>>> >>>>>>>>> Thanks. >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> H.J. >>>>>>>>> ---- >>>>>>>>> 2011-03-14 =A0H.J. Lu =A0 >>>>>>>>> >>>>>>>>> =A0 =A0 =A0 =A0PR target/46770 >>>>>>>>> =A0 =A0 =A0 =A0* acinclude.m4 (gcc_AC_INITFINI_ARRAY): Removed. >>>>>>>>> >>>>>>>>> =A0 =A0 =A0 =A0* config.gcc (use_initfini_array): New variable. >>>>>>>>> =A0 =A0 =A0 =A0Use initfini-array.o if supported. >>>>>>>>> >>>>>>>>> =A0 =A0 =A0 =A0* crtstuff.c: Don't generate .ctors nor .dtors sec= tions if >>>>>>>>> =A0 =A0 =A0 =A0NO_CTORS_DTORS_SECTIONS is defined. >>>>>>>>> >>>>>>>>> =A0 =A0 =A0 =A0* configure.ac: Remove gcc_AC_INITFINI_ARRAY. =A0A= dd >>>>>>>>> =A0 =A0 =A0 =A0--enable-initfini-array and check if .init_array c= an be used with >>>>>>>>> =A0 =A0 =A0 =A0.ctors. >>>>>>>>> >>>>>>>>> =A0 =A0 =A0 =A0* configure: Regenerated. >>>>>>>>> >>>>>>>>> =A0 =A0 =A0 =A0* config/initfini-array.c: New. >>>>>>>>> =A0 =A0 =A0 =A0* config/initfini-array.h: Likewise. >>>>>>>>> =A0 =A0 =A0 =A0* config/t-initfini-array: Likewise. >>>>>>>>> >>>>>>>>> =A0 =A0 =A0 =A0* config/arm/arm.c (arm_asm_init_sections): Call >>>>>>>>> =A0 =A0 =A0 =A0elf_initfini_array_init_sections if NO_CTORS_DTORS= _SECTIONS >>>>>>>>> =A0 =A0 =A0 =A0is defined. >>>>>>>>> =A0 =A0 =A0 =A0* config/avr/avr.c (avr_asm_init_sections): Likewi= se. >>>>>>>>> =A0 =A0 =A0 =A0* config/ia64/ia64.c (ia64_asm_init_sections): Lik= ewise. >>>>>>>>> =A0 =A0 =A0 =A0* config/mep/mep.c (mep_asm_init_sections): Likewi= se. >>>>>>>>> =A0 =A0 =A0 =A0* config/microblaze/microblaze.c (microblaze_elf_a= sm_init_sections): >>>>>>>>> =A0 =A0 =A0 =A0Likewise. >>>>>>>>> =A0 =A0 =A0 =A0* config/rs6000/rs6000.c (rs6000_elf_asm_init_sect= ions): Likewise. >>>>>>>>> =A0 =A0 =A0 =A0* config/stormy16/stormy16.c (xstormy16_asm_init_s= ections): >>>>>>>>> =A0 =A0 =A0 =A0Likewise. >>>>>>>>> =A0 =A0 =A0 =A0* config/v850/v850.c (v850_asm_init_sections): Lik= ewise. >>>>>>>>> >>>>>>>> >>>>>>>> PING: >>>>>>>> >>>>>>>> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00760.html >>>>>>>> >>>>>>> >>>>>>> Any comments? =A0Any objections? >>>>>>> >>>>>> >>>>>> Here is the patch updated for the current trunk. =A0OK for trunk? >>>>>> >>>>> >>>>> PING,. >>>> >>>> Hi Richard, >>>> >>>> You commented my patch was stage 1 material: >>>> >>>> http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01989.html >>>> >>>> Is my patch: >>>> >>>> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00760.html >>>> >>>> OK for trunk? >>> >>> I can't approve the configury changes and would like to defer >>> to target maintainers for the target specific changes. =A0That said, >>> I'm not familiar enough with the area of the patch. =A0But yes, >>> it's stage1 now - so if anyone else wants to approve this patch... >> >> My first attempt: >> >> http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00589.html >> >> only affects x86. =A0I changed it to generic based on the >> feedbacks. =A0But other target maintainers show no interests. >> Should I make it x86 only first? =A0Each target can enable it >> if needed. >> > > I am enclosing 2 patches here. =A0One only affects Linux/x86 > and the other covers all targets. =A0I tested both versions on > Linux/x86 without any regressions. =A0Since I only got OK from > one target maintainer and I have been pinging on this patch > for more than 6 months, I'd like to get it enabled for Linux/x86 > soon. > Hi Ian, I'd like to get this issue resolved, at least for Linux/x86. Can you recommend how I should proceed? Thanks. --=20 H.J.