博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux下查看动态链接库依赖关系的命令 x86: ldd *.so arm: arm-linux-readelf -d *.so 实际例子: 以项目中用到的库librtsp...
阅读量:6228 次
发布时间:2019-06-21

本文共 5015 字,大约阅读时间需要 16 分钟。

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

x86:
ldd    *.so

arm:

arm-linux-readelf    -d    *.so

实际例子:
以项目中用到的库librtsp.so分析:
 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

 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详解 

Linux的nm查看动态和静态库中的符号 

Linux命令学习手册-readelf命令 

eCos编译Synthethic Target程序时无法解析__sprintf_chk的解决办法 

转载地址:http://idina.baihongyu.com/

你可能感兴趣的文章
[转]MySQL主从复制(Master-Slave)与读写分离(MySQL-Proxy)实践
查看>>
SqlServer查询中使用事务
查看>>
ipv6相关
查看>>
粒子加到骨骼中
查看>>
VS2010几款超赞的扩展辅助工具总结
查看>>
Tomcat embed
查看>>
Asp.Net Web API 2第六课——Web API路由和动作选择
查看>>
如何使用seajs+jQuery构建中型项目
查看>>
js html5推送 实例
查看>>
ASP.NET div信息提示框显示几秒后隐藏
查看>>
常用的正则表达式C#工具类
查看>>
IOS适配
查看>>
WhyDX9:翻写D3D红龙书中的程序
查看>>
RFC 4627 JSON
查看>>
UML类图
查看>>
Flex父子窗体相互调用
查看>>
AP_应付模组在月结的处理
查看>>
javascript如何判断访问网页的设备及是否支持触屏功能
查看>>
MFC 虚函数与消息映射区别
查看>>
每日一小练——列出全部子集
查看>>