This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: Bug with dlclose and static class elements
- To: Harald Hoyer <Harald.Hoyer@hot.spotline.de>
- Subject: Re: Bug with dlclose and static class elements
- From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
- Date: 01 Feb 1999 10:56:50 +0100
- Cc: linux-gcc@vger.rutgers.edu, libc-alpha@cygnus.com
- Cc: egcs@egcs.cygnus.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