linux下查看动态链接库依赖关系的命令 x86: ldd *.so arm: arm-linux-readelf -d *.so 实际例子: 以项目中用到的库librtsp.so分析: lijun@ubuntu:~/workspace$ arm-hisiv100nptl-

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

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

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

lijun@ubuntu:~/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-08-18 09:50:42

linux下查看动态链接库依赖关系的命令 x86: ldd *.so arm: arm-linux-readelf -d *.so 实际例子: 以项目中用到的库librtsp.so分析: lijun@ubuntu:~/workspace$ arm-hisiv100nptl-的相关文章

linux下查看动态链接库so文件的依赖的相关组建

我们很多c程序在windows下是以dll形式展现的,在linux则是以so 形式展现的.   windows一般不会因为编译dll文件的编译器版本不同而出先dll文件不能执行.   但是linux下,不同版本内核的linux下编译的c程序,在其他版本的linux下就容易出现无法执行的问题.主要可能是支持程序的内核相对于编译时的内核较高或者版本相对于编译时的内核较低.   那我们如何看别人给我们提供的动态链接库文件(so后缀的)是否能在当前linux系统下可用呢.首先我们就要看他依赖的相关文件是

Linux下查看CPU型号,内存大小,硬盘空间的命令(详解)_Linux

1 查看CPU 1.1 查看CPU个数 # cat /proc/cpuinfo | grep "physical id" | uniq | wc -l 2 **uniq命令:删除重复行;wc –l命令:统计行数** 1.2 查看CPU核数 # cat /proc/cpuinfo | grep "cpu cores" | uniq cpu cores : 4 1.3 查看CPU型号 # cat /proc/cpuinfo | grep 'model name' |un

linux下查看内存

前言:在Linux上不像在Windows上看内存那样方便,而且还有Swap这个新的概念,所以知道如何来看Linux内存还是有一定意义的. 在Linux下查看内存我们一般用command free [root@nonamelinux ~]# free total used free shared buffers cached Mem: 386024 377116 8908 0 21280 155468 -/+ buffers/cache: 200368 185656 Swap: 393552 0

Centos下查看网卡的实时流量命令

  本文介绍了linux下查看网卡流量的六种方法,linux系统中使用nload.iftop.iostat等工具查看网卡流量,这里我们先来详细讲解下 iptraf 方法,需要的朋友参考下. 可以通过iptraf命令查看网卡的实时流量,图像非常直观. 今天在测试服务器上准备看下网络流量 代码如下: [root@localhost ~]# iptraf -d eth0 -bash: iptraf: command not found 发现运维同事没有给安装,只能自己手工安装了 首先安装需要的包: 代

linux下Mysql的启动关闭的命令

 下面我来为各位介绍linux下Mysql的启动关闭的命令,有需要了解的朋友不防进入看看吧.     linux下Mysql的启动关闭(本文基于centos6.4.mysql5.7.3),mysql安装在/usr/local/mysql目录下: [root@lnmp ~]# /usr/local/mysql/bin/mysql --version /usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.7.3-m13, for Linux (x86_64)

源代码-怎么样再linux下查看dump_stack()函数打印出来的信息?

问题描述 怎么样再linux下查看dump_stack()函数打印出来的信息? 本人Linux小白,刚学没多久,最近我想要研究下linux中打开文件操作的流程,于是我就在内核的filp open()函数的源代码中插入了dump_stack_()函数. 我重新编译内核之后,直接在终端调用cd 命令行,然后想在系统日志里面看看有没有 函数调用打印出来,但是翻来翻去好像什么都没有的样子. 但是我自己写一个简单的模块,里面有dump_stack_函数,在编译模块,再运行这个模块, 这样的话又可以在日志里

linux下查看文件-Linux下如果要在根目录查找内容包含某个字符串的文件,怎么查找啊,谢谢

问题描述 Linux下如果要在根目录查找内容包含某个字符串的文件,怎么查找啊,谢谢 我想在Linux下查看某个函数的定义在那个文件里,前提是我不知道在那个文件夹下面,有谁可以帮我看看啊,谢谢 解决方案 在某个目录下的所有文件的内容中,查找包含某个字符串的文件Linux下查找包含字符串的文件命令linux下查找某个目录下包含某个字符串的文件 解决方案二: 问题终于解决了,非常感谢! 解决方案三: grep -rHwns "search str" / 解决方案四: grep -n &quo

Linux下查看SELinux状态和关闭SELinux的方法

Linux下查看SELinux状态和关闭SELinux的方法  一.查看SELinux状态命令: 1./usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态 SELinux status:                 enabled 2.getenforce                 ##也可以用这个命令检查 二.关闭SELinux方法: 1.临时关闭(不用重启机器): 代码如下: setenforce 0 #设置SE

linux 下查看网卡工作速率

[root@hadoop058 ~]# mii-tool eth0: negotiated 100baseTx-FD, link ok 100M linux 下查看网卡工作速率 Ethtool是用于查询及设置网卡参数的命令. 概要: ethtool ethX //查询ethX网口基本设置 ethtool –h //显示ethtool的命令帮助(help) ethtool –i ethX //查询ethX网口的相关信息 ethtool –d ethX //查询ethX网口注册性信息 ethtool