Loading shared obj implicitly

Started by
1 comment, last by Abominus 22 years ago
What''s the unix/linux equivalent of the win32 LoadLibrary/ GetProcAddress api calls (if they exists)?
Advertisement
quote:Original post by Abominus
What''s the unix/linux equivalent of the win32 LoadLibrary/
GetProcAddress api calls (if they exists)?


Never mind that. I''ve found it. But...

Is there an initialisation function or address in the so (sort of like DllMain in Windows) that is called when the dll is loaded?
quote:Original post by Abominus
Original post by Abominus
What''s the unix/linux equivalent of the win32 LoadLibrary/
GetProcAddress api calls (if they exists)?


Never mind that. I''ve found it. But…

Is there an initialisation function or address in the so (sort of like DllMain in Windows) that is called when the dll is loaded?

void _init() is called when you dlopen() a module (or when it is loaded dynamically by the loader), void _fini() is called when you dlclose() it. A default implementation is supplied so that you don''t have to write them. You can, however, override them if you want.

Hope this helps.

This topic is closed to new replies.

Advertisement