[patch] init_array/fini_array support

Joakim Tjernlund joakim.tjernlund at transmode.se
Tue Jan 24 00:23:52 UTC 2006


 > 
> On Sun, 22 Jan 2006, Joakim Tjernlund wrote:
> 
> >  
> > > 
> > > On Fri, 20 Jan 2006, Joseph S. Myers wrote:
> > > 
> > > > On Fri, 20 Jan 2006, Peter S. Mazinger wrote:
> > > > 
> > > > > > +void
> > > > > > +__libc_csu_fini (void)
> > > > > > +{
> > > > > 
> > > > > this is guarded by LIBC_NONSHARED in glibc, shouldn't we
> > > do the same?
> > > > 
> > > > No, the comment in glibc is "We run the executable's destructor 
> > > > now just like any other." and I don't think this is the case
> > > for uClibc's
> > > > ld.so (if it were, we'd already have been running _fini twice).
> > > 
> > > Could you shed a light why glibc's comment on __libc_csu_fini is:
> > > 
> > > "This function should not be used anymore. ... your 
> comment above ...
> > > We cannot remove the function, though."
> > > 
> > > They can't remove it probably because they have to keep glibc 
> > > compatible (being noop in case of the shared lib), but 
> that is not 
> > > uClibc's problem.
> > > 
> > > Please don't get me wrong objecting so much, I am all for the 
> > > addition of your patch to svn (and will add it if no other 
> > > objections)
> > > 
> > > Thanks, Peter
> > 
> > Looks good to me, please go ahead and commit.
> > 
> >  Jocke
> 
> which do you prefer: w/ or w/o CTOR_DTOR ifdefs?

They should be added, but lets sort out this patch first and add that later.

> 
> What do you think of the size increase? Couldn't we move at 
> least some of it to ld.so? Is there some other reason to have 
> them local in the binary?

That's an interesting idea, but not so easy I think. One would have to move
the apps _init/_fini processing to ld.so and remove them from crt1 or some combination
of both to support static linking.

Also, it would also be problematic to add _init/_fini/_array to ld.so itself, but that
will probably not happen anyway.

one would probably also have to make _init/_fini/_array weak in ld.so to keep
ld happy.

Would be interesting to see a patch though, it would make apps smaller but I am
not sure if there are any dark corners that we have missed.

 Jocke

> 
> Thanks, 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