Subject: Re: C++ q: constructors not called for classes in shared lib ?
To: Jaromir Dolecek <firstname.lastname@example.org>
From: Jim Wise <email@example.com>
Date: 02/04/1999 16:19:01
-----BEGIN PGP SIGNED MESSAGE-----
On Thu, 4 Feb 1999, Jaromir Dolecek wrote:
>Nonstandard for NetBSD or nonstandard for whole word ? At least
>FreeBSD 3.0+ is doing right that (guessing by comment in ltconfig
>-- may be the hack is only no more needed, as F3.0 is using ELF,
>if I recall correctly), I'm not sure about Linux or Slowlaris.
>It's just a bit un-intuitive having to add some special object file
>when linking C++ shared library in order for static constructors
>to work. If it would be 50K of code, I would think it has any reason
>to force people include it explicitely. But not adding that 500B
>to shared library when it may need it and the code may not work correctly
>without it sounds ridiculous to me.
Is there a good reason c++rt0.o can't be included in every library? It
a.) only 500 bytes long
b.) of potential use to _any_ library code
Might we save ourselves a world of pain by including the constructor /
destructor support into all libraries, as we already do on ELF
At any rate, I can't think of too many other platforms that say `you
must include this magic object file manually in your C++ library or it
will build and appear to run normally, but will never execute its
constructors and destructors'...
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
-----END PGP SIGNATURE-----