Problems with shared library (-fPIC) and tango

"Jérôme M. Berger" jeberger at free.fr
Sat Oct 25 01:25:43 PDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sean Kelly wrote:
> Thomas Leonard wrote:
>> Doesn't the dynamic linker already provide for calling static
>> initialisers? I'm not sure.
> 
> Possibly the static initializers that C uses, if any, but not the D
> initializers.

	AFAIK, all you need for some code to be run automatically on module
loading/unloading is to put it in the correct section in the object
file or in a properly named function (depending on the linker). For
example, for GNU ld, sections called .init and .fini are executed
upon module loading and unloading respectively. If the D
initializers were put into these, they would be called
automatically. You can look here for more details:
http://www.delorie.com/gnu/docs/gcc/gccint_149.html

		Jerome
<back to lurk mode/>
- --
+------------------------- Jerome M. BERGER ---------------------+
|    mailto:jeberger at free.fr      | ICQ:    238062172            |
|    http://jeberger.free.fr/     | Jabber: jeberger at jabber.fr   |
+---------------------------------+------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkkC2AMACgkQd0kWM4JG3k88uQCgmW6hYyo93BlaugnUOLzAsisR
hRIAn3AF1nay7Brp347mpZjTbZ4GzWiY
=fbwC
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list