You can use the __attribute__((constructor)) and __attribute__((destructor)) to execute code on load and unload of the shared library.
You can use the __attribute__((constructor)) and __attribute__((destructor)) to execute code on load and unload of the shared library.