Subject: Re: C++ q: constructors not called for classes in shared lib ?
To: Jaromir Dolecek <dolecek@ics.muni.cz>
From: Jim Wise <jwise@unicast.com>
List: current-users
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
is:

	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
platforms?

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

- -- 
				Jim Wise
				jwise@unicast.com

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv

iQEVAwUBNroOyokLDoBfn5jPAQER0ggAolMSrXhBdODlfJMpcnUxCrr4irUv78jW
R7TYGNL2fIlE97+nd9PrG7Qj65QmR/1bL8tB7bdI66Z5DuhjEZ07PoCEz95Q0vee
8o6fyCvLgFUmk7gzsa7+JUqHgTds6b28+cN3smDduHnGneMQBIf2aHNT/d7wrVaH
IoHA8/hBgsf554+HRHjSkaILXjM/KMnvMjD8dJ/WAVkYYttLmiiz/gWqvXyXcA0z
/8akipMhwb4ZYmF7bmUaeEqn2sUvPtNsP7aAcRRqfUw1B72qw7b+5LcdB5wK7Qeu
B8OQD7JgOSTM3TlE92mDwgk+BKV4DQOQQG5s6b5bp8+7LFbPRQiTSg==
=7vY9
-----END PGP SIGNATURE-----