确定Linux二进制文件的直接共享对象依赖关系? [英] Determine direct shared object dependencies of a Linux binary?

查看:57
本文介绍了确定Linux二进制文件的直接共享对象依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何轻松找出ELF格式的Linux二进制文件的直接共享对象依赖性?

How can I easily find out the direct shared object dependencies of a Linux binary in ELF format?

我知道ldd工具,但这似乎可以输出二进制文件的所有依赖项,包括二进制文件所依赖的任何共享对象的依赖项.

I'm aware of the ldd tool, but that appears to output all dependencies of a binary, including the dependencies of any shared objects that binary is dependent on.

推荐答案

您可以使用readelf探索ELF标头. readelf -d将直接依赖项列为NEEDED部分.

You can use readelf to explore the ELF headers. readelf -d will list the direct dependencies as NEEDED sections.

 $ readelf -d elfbin

Dynamic section at offset 0xe30 contains 22 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libssl.so.1.0.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000c (INIT)               0x400520
 0x000000000000000d (FINI)               0x400758
 ...

这篇关于确定Linux二进制文件的直接共享对象依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆