This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PING: PATCH: PR target/46770: Use .init_array/.fini_array sections
- From: Andrew Pinski <pinskia at gmail dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, jakub at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Mar 2012 13:39:38 -0700
- Subject: Re: PING: PATCH: PR target/46770: Use .init_array/.fini_array sections
- References: <BANLkTi=vTT_9j33U5FVNVasqkdt_=qCOyQ@mail.gmail.com> <BANLkTinfhzGcg6oBVeV_LXRQSN1gmtU70g@mail.gmail.com> <BANLkTint+SNsmQxOz-4xk0rrhRPc9L8J8g@mail.gmail.com> <CAMe9rOof=V4c89715u-Z=zG8kqADrupMaemnjuYPJA-xPQaKxg@mail.gmail.com> <20110722123042.GB2687@tyan-ft48-01.lab.bos.redhat.com> <CAMe9rOoqrt_a3ez2-oNa=5gfGQkON741hSrJBgs0xLym5c03KA@mail.gmail.com> <CAMe9rOqYSSvV7roUVgMdBf8oax0j=toMcGu=8eApvYEK4mnUug@mail.gmail.com> <CAMe9rOrpFYbJiNpt715qfgJO=__xxiPbjZ_E45DGB9tCefMdrQ@mail.gmail.com> <20110819081733.GB2687@tyan-ft48-01.lab.bos.redhat.com> <CAMe9rOoWD3KdQHFHFWKEP=CQjYuyukWbY3mjN3bYxeMdqmvrBQ@mail.gmail.com> <20110819145522.GF2687@tyan-ft48-01.lab.bos.redhat.com> <CAMe9rOpehxbKgocsMO7k0NXHmUcG=U5NE2Jeo=suSq7kaHOtsQ@mail.gmail.com> <201203192034.q2JKYmPa022645@greed.delorie.com>
On Mon, Mar 19, 2012 at 1:34 PM, DJ Delorie <dj@redhat.com> wrote:
>
> 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.
This should have been fixed by:
2012-02-23 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* acinclude.m4: Use HAVE_INITFINI_ARRAY_SUPPORT instead of
HAVE_INITFINI_ARRAY to work around namespace pollution in
certain versions of newlib system headers.
* config.in: Regenerate.
* configure: Regenerate.
* config/initfini-array.h: Use HAVE_INITFINI_ARRAY_SUPPORT
instead of HAVE_INITFINI_ARRAY.
Thanks,
Andrew Pinski
>
>> 2011-08-20 ÂH.J. Lu Â<hongjiu.lu@intel.com>
>>
>> Â Â Â 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.