[patch] init_array/fini_array support

Joseph S. Myers joseph at codesourcery.com
Tue Feb 14 02:57:11 UTC 2006


On Tue, 14 Feb 2006, Peter S. Mazinger wrote:

> probably I miss something, a static binary has the hidden *_array_* as 
> listed in __uClibc_main.c (!SHARED) (are in libc.a as undefined), but a 
> dynamic one does not have any reference to _dl_app_*_array (they are in 
> ld.so -defined, libc.so -undefined, libdl.so -undefined).

I don't see the problem.  The init_array and fini_array are available both 
via the magic linker symbols and via the ELF DT_INIT_ARRAY and 
DT_FINI_ARRAY.  In a static binary, the first mechanism is used.  In a 
dynamic binary, __uClibc_main is in libc.so which is linked against ld.so 
and gets the _dl_app_*_array functions from there.

-- 
Joseph S. Myers
joseph at codesourcery.com



More information about the uClibc mailing list