__cxa_atexit and __cxa_finalize implementation

Peter S. Mazinger ps.m at gmx.net
Fri Sep 16 13:34:12 UTC 2005


On Fri, 16 Sep 2005, Joakim Tjernlund wrote:

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

why should it get it from compat_libc , but not from nonshared, the "rule" 
you are saying would apply here too? or do you think that shared libs have 
"priority" over archives?

__libc_stack_end can be added too, but I wonder why glibc does not need 
it?

glibc's list:
elf-init.oS: INITFINI_ARRAY stuff
atexit.oS: atexit()
stat.oS: __stat() and weak stat()
fstat.oS: __fstat() and weak fstat()
lstat.oS: __lstat() and weak lstat()
mknod.oS: __mknod() and weak mknod()
stat64.oS: stat64()
fstat64.oS: fstat64()
lstat64.oS: lstat64()

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