libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: _init in shared libraries?


From: Peter Eisentraut
Subject: Re: _init in shared libraries?
Date: Fri, 9 Mar 2001 18:15:38 +0100 (CET)

Bruce Korb writes:

> Is there supposed to be a way to tell GCC/collect2/ld to
> let me supply my own _init and _fini routines?

ld -init NAME -fini NAME

> Or, am I required to have a pre-determined external name that I must
> reference?  If so, what is the point of _init? *sigh*.

Actually, if you are using GCC then you probably should use
__attribute__((constructor)) and __attribute__((destructor)).  Those might
even work on non-ELF system.

> P.S.  I did a ``gcc -v'', grabbed the collect2 invocation
> and deleted the file containing the unwanted externals.
> Using that invocation resulted in a perfectly working
> shared library with my own _init routine.  Too clumsy for
> real use, tho.

I think what you were trying to do (i.e., supplying own _init) once worked
with stock GCC, but somehow it doesn't anymore.

-- 
Peter Eisentraut      address@hidden       http://yi.org/peter-e/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]