This is the mail archive of the
mailing list for the GCC project.
Re: Global objects in shared libraries
- To: martin at MPA-Garching dot MPG dot DE
- Subject: Re: Global objects in shared libraries
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Thu, 25 Nov 1999 21:23:36 +0100
- CC: gcc at gcc dot gnu dot org
- References: <383D3A57.25D305B7@mpa-garching.mpg.de>
> I'm not sure if this can be called a bug in gcc (the C++ standard
> doesn't say anything about shared libraries, AFAIK), so I'd like to
> hear the opinion of the experts: should global objects in shared
> libraries be constructed at load time and destroyed at unload time,
> or is the behaviour undefined?
From a C++ point of view, it is implementation-defined what
constitutes a program, and dlopen is not a standard C++ library
In g++, constructors in shared libraries are supported if the platform
supports it. ELF-based systems do support it, and so should g++. So
go ahead and submit a full report; if you can analyse this to a
certain degree, that would be even better. Hint: There should be a
section ".ctors" in the assembler file.