GDB failed to load so files and errors No such file or directory

笑着哭i 提交于 2019-12-02 13:27:30
Employed Russian

binary runs on a production host where the libraries are in the path I am running the binary on a development host by setting the solib-search-path

There is your problem right here.

The solib-search-path is the path where GDB will look for libraries.

In no way does that setting affect the binary itself, which uses either standard system library path, compiled-in DT_RPATH, or LD_LIBRARY_PATH environment variable to search for shared libraries.

Usually, solib-search-path should only be set when you are analyzing a core dump that came from some other host (GDB needs access to the exact libraries that were used when the core dump was generated). Setting solib-search-path while running a local binary should never be ncessary -- GDB can automatically deduce where the libraries are by asking the runtime loader where they are.

ldd binary says libraries not found which is expected since this is a development host

If ldd says that, then of course you will not be able to run the binary (inside of outside GDB).

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