Fre*_*red 13 c linux shared-libraries elf
说我有一个图书馆libfoo.so.1,依赖于(根据ldd)libbar.so.1.但是,libbar.so.1暂时不可用.我的应用需要调用一个libfoo.so.1根本不需要的功能libbar.so.1.
有没有办法加载libfoo.so.1,解析函数符号然后调用它而不必libbar.so.1满足依赖?这是"我知道我在做什么,只是让我这样做"的案例.我尝试了RTLD_LAZY标志,但它仍然尝试libbar.so.1在不加载符号之前加载库.
编辑
这是确切的情况.
我们有3名球员:
libbar.so.1,共享库位于路径没有LD_LIBRARY_PATH或ldconfig,且其相关性都得到解决libfoo.so.1, a shared library located in a different directory than libbar, but which depends on libbar. At runtime, libfoo will know where to locate libbar.App, a binary application which needs to load libfoo at some point during runtime.App doesn't know where to find libbar, but knows that libfoo knows. What I'm trying to accomplish is having an init function in libfoo which would simply change App's current working directory to where libbar is located to finally resolve all the dependencies and make everyone happy.
libfoo will eventually need to call stuff in libbar, just not in this init function. I don't think creating a stub would work since the symbols would eventually need to resolve to the real functions.