This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug with dlclose and static class elements
- To: Harald Hoyer <Harald dot Hoyer at hot dot spotline dot de>
- Subject: Re: Bug with dlclose and static class elements
- From: Andreas Schwab <schwab at LS5 dot informatik dot uni-dortmund dot de>
- Date: 01 Feb 1999 10:56:50 +0100
- Cc: linux-gcc at vger dot rutgers dot edu, libc-alpha at cygnus dot com
- Cc: egcs at egcs dot cygnus dot com
- References: <36B06C90.FB888AE2@hot.spotline.de>
Harald Hoyer <Harald.Hoyer@hot.spotline.de> writes:
|> Hi,
|>
|> the attached tarball demonstrates the failure of deleting static elements in
|> classes, if the library that contains these class is unloaded with dlclose.
|>
|> My question is whether this is a glibc (libdl) bug or a bug in generating the
|> code (egcs).
IMHO this is a bug in gcc. It should not use atexit to register the dtor
for static local objects. Instead it should set up an entry in the .dtors
section. There is no (standard) way to unregister an atexit function, and
implementing it would require to put a hook into libc for use by the
dynamic linker.
[For the readers of the egcs list: the full report is available under
http://www-gnats.gnu.org:8080/cgi-bin/wwwgnats.pl/full/938]
--
Andreas Schwab "And now for something
schwab@issan.cs.uni-dortmund.de completely different"
schwab@gnu.org