This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Use .init_arrat/.fini_array if available
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Paul Brook <paul at codesourcery dot com>,Mark Mitchell <mark at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 20 Mar 2005 07:55:18 -0800
- Subject: Re: PATCH: Use .init_arrat/.fini_array if available
- References: <20050319192550.GA27423@nevyn.them.org> <20050320060548.GB29959@lucon.org> <20050320153457.GA26196@nevyn.them.org>
On Sun, Mar 20, 2005 at 10:34:58AM -0500, Daniel Jacobowitz wrote:
> On Sat, Mar 19, 2005 at 10:05:48PM -0800, H. J. Lu wrote:
> > > As far as I can tell, this is a conforming implementation of
> > > __attribute__((constructor)); even a desirable one. Any suggestions on how
> > > to adapt the tests for this implementation?
> > >
> >
> > This is the patch for gcc 3.4. It is very similar to Linux/ia64 port,
> > which is in assembly. It works for me. Glibc calls functions in
> > .init_array like main (). That is what INIT_ARRAY_LIKE_MAIN is used
> > for. Linux developers can take advantage of it. I haven't come up with
> > a better way to check it.
>
> I'm not following you. How does this patch relate to the problem I
> described?
Your glibc problem should be resolved in gcc. Otherwise your target
will be different from other glibc targets. Currently only the
Linux/ia64 target uses .init_array. My gcc patch will make any targets
which support .init_array to use it and pass the glibc test. If your
glibc target supports .init_array, you can use crtstuff.c + my patch,
or something similar to crtstuff.c + my patch, to pass the glibc test.
>
> >
> >
> > H.J.
> > ------
> > 2005-03-18 H.J. Lu <hongjiu.lu@intel.com>
> >
> > * config/linux.h (INIT_ARRAY_LIKE_MAIN): Defined.
> >
> > * crtstuff.c: If HAVE_INITFINI_ARRAY is defined, use
> > .init_array/.fini_array sections instead of .init/.fini
> > sections.
>
> How far back does glibc support this?
Sept, 2002.
H.J.