patch to make init_array work (3nd version)
Roland McGrath
roland@redhat.com
Mon Dec 9 10:52:00 GMT 2002
I had not been aware of the difference in behavior for static vs dynamic
executables when making my previous suggestion. Your change to the calling
convention of the function passed to __libc_start_main would require symbol
versioning of __libc_start_main to avoid creating new executables with the
false appearance of compatibility with existing shared libraries. It's
also an ugly kludge that there is no need for.
I reimplemented it myself. I put the functions called from start.S into
libc.a and libc_nonshared.a with different versions for the two cases, so
the correct behavior (calling the executable's preinit array or not) is
selected at link time instead of using a kludge with run-time overhead.
I also performed the query replace on all the start.S files.
No patch to the generic code in libc is complete without updating all the
existing sysdeps code, and it is not hard to do a query replace. For
future contributions that change generic code in ways that necessitate
updating sysdeps code, please include those changes if you expect your
patches to go in as they are or in a timely fashion.
Thanks,
Roland
More information about the Libc-hacker
mailing list