[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Problem with _init and _fini functions


I am trying to create a shared library in Linux. I want my
shared library to do some initialization on loading and some
cleanup on unloading.

I used _init and _fini functions to do the intializations. But
since I am using C++, (g++) it is mangling the function names
to _init__Fv and _fini__FV in the .o files

As a result these functions are not called when the shared library
is loaded and unloaded. 

How can I avoid this name mangling from happening ?? If it is
a c file, then everything is working fine. i.e. no name mangling
is happening. My shared library is written in C++. :-((

Thanks in advance,
Saravanan S.