On 8/15/05, r_zaca <[EMAIL PROTECTED]> wrote:
>  Hello,

[snipped some code]

The use of _init() and _fini() is strongly discouraged.  Both are
obsolete and their use can lead to some strange behaviour.  Some even
consider them as dangerous.

Instead, you should rely on function attribute constructors and destructors:

        void __attribute__ ((constructor)) my_init(void);
        void __attribute__ ((destructor)) my_fini(void);

Please note: when compiling shared libs with gcc, you _must_ omit the
arguments -nostartfiles or -nostdlib, otherwise the declared routines
will not be executed.

Regards

        \Steve


> 
> >Hi,
> >     While loading Dylibs i want to write my own __init,__fini
> >functions.Would you please tell me how to write those functions >please.
> >
> >Raja
> 
> 

Steve Graegert <[EMAIL PROTECTED]>
Software Consultancy {C/C++ && Java && .NET}
Mobile: +49 (176)  21248869
Office: +49 (9131) 7126409
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" 
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to