[patch] init_array/fini_array support

Peter S. Mazinger ps.m at gmx.net
Tue Jan 31 09:08:32 UTC 2006


On Tue, 31 Jan 2006, Joseph S. Myers wrote:

> On Tue, 31 Jan 2006, Joseph S. Myers wrote:
> 
> > On Mon, 30 Jan 2006, Peter S. Mazinger wrote:
> > 
> > > Would it be possible to add __libc_csu_init/fini to libc.so, or is it too 
> > > late/early? Is there a specific reason to have it in nonshared.a 
> > > (we don't have to mimic glibc for this) ? Does each binary have to have 
> > > it's own copy of it?
> > 
> > The linker defines the symbols such as __init_array_start as hidden 
> > symbols in the executable, so I don't think using them from libc.so will 
> > work.
> 
> I can now confirm after testing that putting these functions in libc.so 
> definitely doesn't work.  (The references to __init_array_start etc. need 
> to be weak simply to get libc to link.)

That is understandable, anything marked w/ attribute_hidden within libc.so 
is not accessable by any app, the only way is to make them visible.

Ok, what can we do to get the size increase down? Go glibc's way?

void __libc_csu_fini(void) {
#ifndef LIBC_NONSHARED
	...
#endif
}
as in glibc (if we at all need the empty __libc_csu_fini() in nonshared.a)

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list