查看动态链接库依赖关系的命令

linux下查看动态链接库依赖关系的命令
x86:
ldd    *.so

arm:
arm-linux-readelf    -d    *.so

实际例子:
以项目中用到的库librtsp.so分析:
[email protected]:~/workspace$ arm-hisiv100nptl-linux-ld -d librtsp.so
arm-hisiv100nptl-linux-ld: warning: liblog.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: libcutils.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: libutils.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: libbinder.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: libssl.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: libcrypto.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: libgui.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: libmedia.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: libstagefright_foundation.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: libc.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: libstdc++.so, needed by librtsp.so, not found (try using -rpath or -rpath-link)
arm-hisiv100nptl-linux-ld: warning: cannot find entry symbol _start; defaulting to 00008204
librtsp.so: undefined reference to `__aeabi_unwind_cpp_pr0‘
librtsp.so: undefined reference to `operator new[](unsigned int)‘
librtsp.so: undefined reference to `__sF‘
librtsp.so: undefined reference to `operator delete[](void*)‘
librtsp.so: undefined reference to `_Unwind_Resume_or_Rethrow‘
librtsp.so: undefined reference to `_Unwind_VRS_Get‘
librtsp.so: undefined reference to `_toupper_tab_‘
librtsp.so: undefined reference to `__gnu_unwind_frame‘
librtsp.so: undefined reference to `__memset_chk‘
librtsp.so: undefined reference to `pthread_key_create‘
librtsp.so: undefined reference to `_Unwind_RaiseException‘
librtsp.so: undefined reference to `__strcat_chk‘
librtsp.so: undefined reference to `operator delete(void*)‘
librtsp.so: undefined reference to `__aeabi_unwind_cpp_pr1‘
librtsp.so: undefined reference to `_tolower_tab_‘
librtsp.so: undefined reference to `__cxa_pure_virtual‘
librtsp.so: undefined reference to `_Unwind_VRS_Set‘
librtsp.so: undefined reference to `_Unwind_GetLanguageSpecificData‘
librtsp.so: undefined reference to `__android_log_print‘
librtsp.so: undefined reference to `pthread_getspecific‘
librtsp.so: undefined reference to `_Unwind_Resume‘
librtsp.so: undefined reference to `__strlen_chk‘
librtsp.so: undefined reference to `_ctype_‘
librtsp.so: undefined reference to `__isthreaded‘
librtsp.so: undefined reference to `_Unwind_Complete‘
librtsp.so: undefined reference to `_Unwind_DeleteException‘
librtsp.so: undefined reference to `_Unwind_GetTextRelBase‘
librtsp.so: undefined reference to `__aeabi_uldivmod‘
librtsp.so: undefined reference to `__swbuf‘
librtsp.so: undefined reference to `_Unwind_GetDataRelBase‘
librtsp.so: undefined reference to `pthread_key_delete‘
librtsp.so: undefined reference to `__sprintf_chk‘
librtsp.so: undefined reference to `_Unwind_GetRegionStart‘
librtsp.so: undefined reference to `__errno‘
librtsp.so: undefined reference to `operator new(unsigned int)‘
librtsp.so: undefined reference to `pthread_setspecific

[email protected]:~/workspace$ arm-hisiv100nptl-linux-readelf -d librtsp.so

Dynamic section at offset 0x93c14 contains 34 entries:
  Tag        Type                         Name/Value
 0x00000003 (PLTGOT)                     0x94e34
 0x00000002 (PLTRELSZ)                   896 (bytes)
 0x00000017 (JMPREL)                     0x40a08
 0x00000014 (PLTREL)                     REL
 0x00000011 (REL)                        0x37eb8
 0x00000012 (RELSZ)                      35664 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffa (RELCOUNT)                   4380
 0x00000006 (SYMTAB)                     0x114
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000005 (STRTAB)                     0xe264
 0x0000000a (STRSZ)                      148452 (bytes)
 0x00000004 (HASH)                       0x32648
 0x00000001 (NEEDED)                     Shared library: [liblog.so]
 0x00000001 (NEEDED)                     Shared library: [libcutils.so]
 0x00000001 (NEEDED)                     Shared library: [libutils.so]
 0x00000001 (NEEDED)                     Shared library: [libbinder.so]
 0x00000001 (NEEDED)                     Shared library: [libssl.so]
 0x00000001 (NEEDED)                     Shared library: [libcrypto.so]
 0x00000001 (NEEDED)                     Shared library: [libgui.so]
 0x00000001 (NEEDED)                     Shared library: [libmedia.so]
 0x00000001 (NEEDED)                     Shared library: [libstagefright_foundation.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so]
 0x00000001 (NEEDED)                     Shared library: [libm.so]
 0x0000000e (SONAME)                     Library soname: [librtsp.so]
 0x0000001a (FINI_ARRAY)                 0x90084
 0x0000001c (FINI_ARRAYSZ)               4 (bytes)
 0x00000019 (INIT_ARRAY)                 0x90088
 0x0000001b (INIT_ARRAYSZ)               36 (bytes)
 0x00000010 (SYMBOLIC)                   0x0
 0x0000001e (FLAGS)                      SYMBOLIC BIND_NOW
 0x6ffffffb (FLAGS_1)                    Flags: NOW
 0x00000000 (NULL)                       0x0
 
 
参考:
apk相关和loadLibrary详解
http://www.cnblogs.com/lijunamneg/archive/2012/11/30/2795577.html

Linux的nm查看动态和静态库中的符号
http://www.cnblogs.com/itech/archive/2012/09/16/2687423.html

Linux命令学习手册-readelf命令
http://blog.chinaunix.net/uid-9525959-id-2001833.html

eCos编译Synthethic Target程序时无法解析__sprintf_chk的解决办法
http://blog.csdn.net/zoomdy/article/details/10615853

查看动态链接库依赖关系的命令

时间: 2024-10-08 09:54:47

查看动态链接库依赖关系的命令的相关文章

在SQL Server中查看对象依赖关系

原文 在SQL Server中查看对象依赖关系 Viewing object dependencies in SQL Server Deleting or changing objects may affect other database objects like views or procedures that depends on them and in certain instances, can “break” the depending object. An example can

linux学习笔记——进程的查看和管理、systemctl命令

###########################################################################第七单元##########################################################################1.什么是进程.线程进程是一个具有独立功能的程序关于某个数据集合的一次运动活动,进程也就是系统正在做的事情线程是进程作为分配资源的基本单位. 2.进程状态运行休眠停止继续结束僵尸进程(已经结束了

【译】Gradle 的依赖关系处理不当,可能导致你编译异常

文章 | Ashesh Bharadwaj 翻译 | 承香墨影 授权 承香墨影 翻译.编辑并发布 在 Android Studio 中,Gradle 构建过程对于开发者来说,很大程度上是抽象的.作为一个新的 Android 开发者,我们第一次遇到 Gradle 通常是在 build.gradle 文件中添加一个远程依赖项. 让我们看看如何阅读 Gradle 依赖关系树,并解决与依赖关系有关的问题. 这是我工作中管理的一个项目,我想将 targetVersion 升级到 27,我也在 Gradle

在Ubuntu宿主机上查看ARM交叉编译好的可执行程序和库文件的相关依赖关系,类似于PC上的ldd命令

在电脑上安装的Linux系统中,有一个ldd命令,可以查看对应的可执行文件或库文件依赖哪些库,但可执行文件或库文件要求与操作系统的编译器类型相同,即电脑是X86的GCC编译器,那么无法通过ldd命令查看ARM交叉编译器编译出来的可执行文件或库文件. 如果想在Ubuntu等Linux宿主机上查看ARM交叉编译好的可执行程序和库文件的相关依赖关系,可以通过以下命令: [email protected]:$ arm-linux-readelf  -a  busybox |grep "Shared&qu

Intellij IDEA 中如何查看maven项目中所有jar包的依赖关系图

Maven 组件界面介绍 如上图标注 1 所示,为常用的 Maven 工具栏,其中最常用的有: 第一个按钮:Reimport All Maven Projects 表示根据 pom.xml 重新载入项目.一般单我们在 pom.xml 添加了依赖包或是插件的时候,发现标注 4 的依赖区中没有看到最新写的依赖的话,可以尝试点击此按钮进行项目的重新载入. 第六个按钮:Execute Maven Goal 弹出可执行的 Maven 命令的输入框.有些情况下我们需要通过书写某些执行命令来构建项目,就可以通

Maven查看JAR包的依赖关系

如果是用命令行,可进入项目所在目录,然后输入: mvn dependency:tree ,来查看jar包依赖关系. 另外还可以在eclipse操作,如下图所示: 点击run后,开始输出JAR包依赖树. 我在执行这步的时候报了下面的异常: Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.graph.DependencyNode 在网上搜了好多地方都没有类似的错误,后来参考了一些帖子,怀疑是maven-dependen

查看maven项目的依赖关系 mvn dependency:tree

查看maven项目的依赖,我们可以用下面命令: mvn dependency:tree 以Dubbo的 dubbo-demo-provider 为例,我们输入这个命令可以获得下面信息: mvn dependency:tree [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.alibaba:dub

【1】Dll依赖与被依赖关系查看工具

[1]工具主界面 [2]工具的功能介绍 2.1 查看Dll依赖的Dll列表(一级关系,如果依赖的Dll不在该目录下,则不显示到右侧) 如: 选择Dll的目录,软件自动获取该目录的Dll列表,并显示到左侧.选择左侧某个特定的Dll,右侧会显示该Dll依赖或被依赖的Dll列表. 2.2 查看Dll被依赖的Dll列表(即依赖此Dll的Dll列表.一级关系,如果被依赖的Dll不在该目录下,则不显示到右侧) [2]下载地址 1.0版本: 

13. 查看数据库对象间的依赖关系

在SQL Server中,(可编程)对象间的引用即依赖关系,有多种方式可以检查,随着版本变更,方式也有所不同. 父子关系的对象,不通过依赖关系来查询,比如: 1. 外键关系 use tempdb GO --drop table tb1,tb2 create table tb1 ( col1 int Primary key, col2 int ) insert into tb1 values (2,2),(3,2),(4,2),(5,2) GO create table tb2 ( col3 in