gdc so files

sclytrack sclytrack at pi.be
Fri Jan 12 11:12:33 PST 2007


> The -nostartfiles point is important: gcc has default versions of these 
> functions that it will want to link in. If you end up using both this 
> and GCC's version, it gets very confused. -nostartfiles tells it to not 
> use the defaults, so these can be used instead.
> 
> These days, _init and _fini are deprecated in favor of some built-in GCC 
> macros. These are obviously not available in D. Their use in Pyd is 

1) More Information

I wish there was some more information about
shared libraries for linux on "some" place.

Maybe with linking with a C file, for the
__attribute__((constructor))

Since gcc is readily available on linux


2) Shared Library _minit() and _moduleCtors()

I don't find the _minit() routine, in what file is it located?
What does _moduleCtor() do exactly, does anybody know? 

These two routines are called in the windows DLL version.

The two routines above don't appear to be called
in the PyD (linux) project. (nice project by the way, and thanks 
the reference to _init() and _fini() )

I've linked it with the so file and the static this()
and ~this() appear to be called of the from the module in the shared library. Automatically. Without me telling to do so.

Just wondering whether the _moduleCtor() calls these static this()
or not. For me it segfaults
on that routine, but I don't have the _minit().



More information about the Digitalmars-d-learn mailing list