This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Hardening of __do_global_dtors_aux
- From: Ian Lance Taylor <iant at google dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org, Ulrich Drepper <drepper at redhat dot com>
- Date: 03 May 2007 13:06:41 -0700
- Subject: Re: [PATCH] Hardening of __do_global_dtors_aux
- References: <20070503090002.GN355@devserv.devel.redhat.com> <20070503195136.GA21778@redhat.com>
Richard Henderson <rth@redhat.com> writes:
> On Thu, May 03, 2007 at 05:00:03AM -0400, Jakub Jelinek wrote:
> > * crtstuff.c (HIDDEN_DTOR_LIST_END): New macro.
> > (__do_global_dtors_aux): Use more paranoid loop to run
> > destructors if HIDDEN_DTOR_LIST_END.
> > (__DTOR_END__): Export as a hidden symbol when HIDDEN_DTOR_LIST_END.
>
> Ok.
>
> Do you think we ought to be transitioning Linux targets to
> the .init_array mechanism? Is there a good way to merge
> any legacy .ctors/.dtors sections in user's object files
> into .init_array, so we can do away with __do_global_dtors_aux
> and __do_global_ctors_aux? If we can't get rid of those two
> functions, it almost doesn't seem worthwhile converting to
> the .init_array mechanism.
Seems to me the linker could just put .ctors/.dtors into
.init_array/.fini_array. Then gcc could use some sort of horrible
configure test.
Ian