__cxa_atexit and __cxa_finalize implementation

Joakim Tjernlund joakim.tjernlund at lumentis.se
Fri Sep 16 13:15:54 UTC 2005


> 
> On Fri, 16 Sep 2005, Peter S. Mazinger wrote:
> 
> > On Thu, 15 Sep 2005, Stephen Warren wrote:
> >
> > Attached are my patches:
> > nonshared:
> > -adds support generally for any files to uclibc_nonshared.a
> > -creates the needed linker script
> > -it does not check for existence of files (fails if no nonshared_obj.*
> > file is present)
> >
> > atexit:
> > adds atexit to nonshared lib, applies after the cxa_atexit... patch
> >
> > Be aware, this will for sure kill most of the apps (all that used atexit()
> > ) it will be an incompatible change to uClibc.
> 
> I have "created" a compat old_atexit (really a copy of the new atexit,
> but not hidden), with weak_alias to atexit (that could allow updating)
> 
> How will the linker script react for newly built binaries?
> /* GROUP ( /lib/libc.so.0 /usr/lib/uclibc_nonshared.a )
> Will the weak atexit from libc.so.0 be taken, or the hidden atexit from
> nonshared.a? I am hoping for the latter case ...

Don't think so, the weak atexit will be taken before the one uclibc_nonshared.a
Possibly you could do:
GROUP ( /lib/libc.so.0 /usr/lib/uclibc_nonshared.a /some_path/compat_libc.so )
where compat_libc.so contains atexit(). Maybe you can add __libc_stack_end there too?

 Jocke




More information about the uClibc mailing list