__cxa_atexit and __cxa_finalize implementation

Stephen Warren swarren at wwwdotorg.org
Sat Sep 24 05:40:12 UTC 2005


Peter S. Mazinger wrote:
> I have rebuilt a gentoo base development system applying this cxa_atexit 
> patch to uclibc and using --enable-cxa_atexit to build gcc. I can't see 
> until now any problems, but it would be good to have some test scenario 
> or app that is known to fail.

Here's another test case, that uses a DSO with global ctors/dtors loaded 
via dlopen().

It works with the original completely unpatched uClibc, no doubt because 
global dtors on DSO unload are handled in some non-cxa_atexit fashion.

With just my patche, it breaks, because the C compiler is using 
__cxa_atexit, but my patch doesn't implement the semantics completely 
correctly. (Failure is a segfault, due to the DOS's atexit function 
being called at app exit time, rather than DSO unload time)

With both our patches, everything should work just fine.

Build with x.sh (after adjusting compiler paths), then run ./dl-2 
executable.

dl.cpp is the app, dso.cpp is source to a DSO.

-- 
Stephen Warren, Software Engineer, NVIDIA, Fort Collins, CO
swarren at wwwdotorg.org     http://www.wwwdotorg.org/pgp.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x.sh
Type: application/x-sh
Size: 371 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20050923/8ee26020/attachment.sh 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dl.cpp
Url: http://lists.busybox.net/pipermail/uclibc/attachments/20050923/8ee26020/attachment.diff 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dso.cpp
Url: http://lists.busybox.net/pipermail/uclibc/attachments/20050923/8ee26020/attachment-0001.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20050923/8ee26020/attachment.pgp 


More information about the uClibc mailing list