zoukankan      html  css  js  c++  java
  • ARM开发板上查看动态库或者可执行程序的依赖关系

    以ARM32开发板为例,在/lib下有一个名为ld-linux-armhf.so.3的可执行程序(在ARM64开发板上是/lib/ld-linux-aarch64.so.1),这个程序负责加载可执行程序以及依赖的动态库:

    # /lib/ld-linux-armhf.so.3 
    Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
    You have invoked `ld.so', the helper program for shared library executables.
    This program usually lives in the file `/lib/ld.so', and special directives
    in executable files using ELF shared libraries tell the system's program
    loader to load the helper program from this file.  This helper program loads
    the shared libraries needed by the program executable, prepares the program
    to run, and runs it.  You may invoke this helper program directly from the
    command line to load and run an ELF executable file; this is like executing
    that file itself, but always uses this helper program from the file you
    specified, instead of the helper program file specified in the executable
    file you run.  This is mostly of use for maintainers to test new versions
    of this helper program; chances are you did not intend to run this program.
    
      --list                list all dependencies and how they are resolved
      --verify              verify that given object really is a dynamically linked
                            object we can handle
      --inhibit-cache       Do not use /etc/ld.so.cache
      --library-path PATH   use given PATH instead of content of the environment
                            variable LD_LIBRARY_PATH
      --inhibit-rpath LIST  ignore RUNPATH and RPATH information in object names
                            in LIST
      --audit LIST          use objects named in LIST as auditors

    然后使用--list参数就可以查看依赖的库:

    # /lib/ld-linux-armhf.so.3 --list /usr/bin/stressapptest 
            linux-vdso.so.1 (0xbeeef000)
            librt.so.1 => /lib/librt.so.1 (0xb6ece000)
            libpthread.so.0 => /lib/libpthread.so.0 (0xb6eaa000)
            libstdc++.so.6 => /lib/libstdc++.so.6 (0xb6d9f000)
            libm.so.6 => /lib/libm.so.6 (0xb6d23000)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6cfa000)
            libc.so.6 => /lib/libc.so.6 (0xb6c0d000)
            /lib/ld-linux-armhf.so.3 (0xb6ee4000)

    此外,也可以使用readelf来查看库的依赖关系:

    readelf -a <可执行程序> | grep NEEDED

    完。

  • 相关阅读:
    “混乱有序”一首关于概率论的诗
    关于“混乱有序”理论的讨论 2020-09-20
    关于“混乱有序”理论的讨论 2020-08-30
    【Java】(有步骤!)模逆、模幂、十进制转十六进制、十六进制转十进制、xTime算法、LFSR画状态图、椭圆曲线加法、椭圆曲线乘法、获得椭圆曲线上的点
    算法导论第一课
    经典力学:第一课
    计算机科学及编程导论:第一课
    微积分重点:第十六至十八课
    微积分重点:第十四,十五课
    微积分重点:第十课至十三课
  • 原文地址:https://www.cnblogs.com/pengdonglin137/p/11994747.html
Copyright © 2011-2022 走看看