This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Hardening of __do_global_dtors_aux


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]