patch to make init_array work (2nd version; resend)
David Mosberger
davidm@napali.hpl.hp.com
Thu Nov 7 18:30:00 GMT 2002
>>>>> On Thu, 7 Nov 2002 18:20:09 -0800, Roland McGrath <roland@redhat.com> said:
>> On Thu, Nov 07, 2002 at 01:58:52PM -0800, Roland McGrath wrote: >
>> That seems like a reasonable thing to do, though it's unfortunate
>> it means > changing all the platforms' start.S files. For
>> preinit_array+init_array, > start.S could just contain the code
>> in the .init section, no? But probably > it is better to write
>> generic _init/_fini replacements in C.
>>
>> I think the best solution is to write
>>
>> static void do_all_init(void) { // Loop over .preinit_array //
>> Loop over .init_array _init (); }
>>
>> or whatever the proper ordering is, and then pass this new
>> function to __libc_start_main.
Roland> Yup, that's the C I was talking about.
I suppose it makes sense to put do_all_init() and do_all_fini() in a
shared source file. Do you want to do that or should I work on it?
If the latter, just tell me where you want the functions.
--david
More information about the Libc-hacker
mailing list