I using LD_PRELOAD to hook function like LD_PRELOAD=my_lib.so ./my_exec
How can I unload my_lib.so when the hook function called without restart the process?
I using LD_PRELOAD to hook function like LD_PRELOAD=my_lib.so ./my_exec
How can I unload my_lib.so when the hook function called without restart the process?
You can't unload a preloaded libraray.
However what you could do is implement a my_lib_shim.so as wrapper-shim that later on loads the library proper using dlopen and populate the hooks with dlsym. Unloading then was possible with dlclose.