replace a dynamic shared library in run time
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to use different dynamic library over a execution cycle of a program. Looking at dlfcn.h I thought this was possible. I confess of not reading much literature on dynamic library loading. OK here is what I do - I have created shared library called `libdynamicTest.so.1` The main APP opens this solib ( dlopen ), gets the function pointer ( dlsym ), run it and then close it back ( dlclose ) Everything is fine until here. Now suppose I replace my libdynamicTest.so.1 by another libdynamicTest.so.1 (some code diff) I see a Segmentation fault