Linux 中的依赖解析
在 Windows 下,我使用了一个名为 Dependency Walker 的程序来检查应用程序使用的库。 我想知道如何在 Linux 上实现标准二进制文件:
ELF 32 位 LSB 可执行文件、Intel 80386、版本 1 (SYSV)、动态链接(使用共享库)、GNU/Linux 2.6.0、剥离
谢谢。
Under Windows, I have used a program called Dependency Walker to examine the libraries the application uses. I was wondering how I can achieve this on Linux for a standard binary:
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.0, stripped
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
尝试:
例如:
请注意,这只会报告共享库。 如果您需要找出在编译时链接了哪些静态库,那就有点棘手了,特别是当您的可执行文件被“剥离”(没有调试符号)时。
Try:
For example:
Note that this will only report shared libraries. If you need to find out what static libraries were linked in at compile time, that's a bit trickier, especially seeing as your executable is 'stripped' (no debugging symbols).
使用ldd
Use
ldd
如果您想要比迭代调用 ldd 更原始的东西,并且更像 MSVC 依赖,您应该尝试 Visual-ldd 。 它已经 4 年没有更新了,但考虑到 ELF 格式没有改变,它应该仍然可以工作。 它仍然不会向您显示这些库中的各个符号 - 为此您需要类似 nm 的东西,不幸的是,我不知道有任何 GUI 包装器。
If you want something a little less raw than iteratively calling ldd and somewhat more like MSVC depends, you should try Visual-ldd. It hasn't been updated in 4 years, but it should still work given that the ELF format hasn't changed. It still won't show you individual symbols inside those libraries - for that you'll need something like nm, and I don't know of any GUI wrapper for that, unfortunately.
使用 ldd。 它将显示二进制文件所需的动态库。
请注意,库本身可能又需要更多库。 要获得这些,您可以在通过对二进制文件运行 ldd 获得的库上运行 ldd。
Use ldd. It will show the dynamic libraries the binary needs.
Note that the libraries themselves may in turn need more libraries. To get these, you can run ldd on the libraries you got from running ldd on the binary.