How to blacklist a shared library to avoid it being fetched by the loader?

与世无争的帅哥 提交于 2020-01-14 10:32:29

问题


I'm trying to force a build internal pre-processor used for built-sources to not rely on shared libraries installed in my host machine without having to uninstall them.

Although there is a LD_PRELOAD environment variable which forces the loader (ld-linux) to fetch the specified shared libraries before anything else, I'd like to do quite the opposite, forcing the loader not to fetch the specified libraries during the setup process (kind of LD_NEVERLOAD variable).

Is there some way to do so without breaking my entire system (aka, removing such libraries)?

PS: I've renamed my system libraries to test this specific use case, but this is definitely not an elegant way of doing so.


回答1:


Reading the manual pages ld(1) and ld.so(8) you might try playing with LD_LIBRARY_PATH, LD_RUNPATH and options in both manuals which are related to "rpath".



来源:https://stackoverflow.com/questions/13260114/how-to-blacklist-a-shared-library-to-avoid-it-being-fetched-by-the-loader

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!