This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Global objects in shared libraries


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

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.

Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]