zoukankan      html  css  js  c++  java
  • Linux ldd命令举例说明

    转载自:https://www.howtoforge.com/linux-ldd-command/ 

    Linux ldd Command Explained with Examples

    If your work involves deep knowledge of executables and shared libraries in Linux, there are several command-line tools that you should be aware of. One of those is ldd, which you can use to access shared object dependencies. In this tutorial, we will discuss the basics of this utility using some easy to understand examples.

     

    Please note that all examples mentioned here have been tested on Ubuntu 18.04 LTS.

    Linux ldd command

    As already mentioned in the beginning, the ldd command prints shared object dependencies. Following is the command's syntax:

    ldd [option]... file...

    And here's how the tool's man page explains it:

    ldd prints the shared objects (shared libraries) required by each program or shared object 
    specified on the command line.

    The following Q&A-styled examples should give you a better idea on how ldd works.

    Q1. How to use the ldd command?

    Basic usage of ldd is fairly simple - just run the 'ldd' command along with an executable or shared object file name as input.

    ldd [object-name]

    For example:

    ldd test

    How to use ldd

    So you can see all shared library dependencies have been produced in output.

    Q2. How to make ldd produce detailed information in output?

    If you want ldd to produce detailed information, including symbol versioning data, you can use the -v  command line option. For example, the command

    ldd -v test

    produced the following in output when the -v command-line option was used:

    How to make ldd produce detailed information in output

    Q3. How to make ldd produce unused direct dependencies?

    For this info, use the -u command-line option. Here's an example:

    ldd -u How to make ldd produce unused direct dependenciesons?

    There are a couple of command line options you can use here: -d and -r. While the former tells ldd to perform data relocations, the latter makes ldd perform relocations for both data objects and functions. In both cases, the tool reports missing ELF objects (if any).

    ldd -d
    ldd -r

    Q5. How get help on ldd?

    The --help command line option makes ldd produce useful usage-related information for the tool.

    ldd --help

    How get help on ldd

    Conclusion

    Agreed, ldd doesn't fall into the category where tools like cd, rm, and mkdir fit in. That's because it's built for a specific purpose, and it does what it promises. The utility offers limited command line options, and we've covered most of them here. To know more, head to ldd's man page.

    Linux ldd Command Explained with Examples

    If your work involves deep knowledge of executables and shared libraries in Linux, there are several command-line tools that you should be aware of. One of those is ldd, which you can use to access shared object dependencies. In this tutorial, we will discuss the basics of this utility using some easy to understand examples.

     

    Please note that all examples mentioned here have been tested on Ubuntu 18.04 LTS.

    Linux ldd command

    As already mentioned in the beginning, the ldd command prints shared object dependencies. Following is the command's syntax:

    ldd [option]... file...

    And here's how the tool's man page explains it:

    ldd prints the shared objects (shared libraries) required by each program or shared object 
    specified on the command line.

    The following Q&A-styled examples should give you a better idea on how ldd works.

    Q1. How to use the ldd command?

    Basic usage of ldd is fairly simple - just run the 'ldd' command along with an executable or shared object file name as input.

    ldd [object-name]

    For example:

    ldd test

    How to use ldd

    So you can see all shared library dependencies have been produced in output.

    Q2. How to make ldd produce detailed information in output?

    If you want ldd to produce detailed information, including symbol versioning data, you can use the -v  command line option. For example, the command

    ldd -v test

    produced the following in output when the -v command-line option was used:

    How to make ldd produce detailed information in output

     

    Q3. How to make ldd produce unused direct dependencies?

    For this info, use the -u command-line option. Here's an example:

    ldd -u test

    How to make ldd produce unused direct dependencies

    Q4. How make ldd perform relocations?

    There are a couple of command line options you can use here: -d and -r. While the former tells ldd to perform data relocations, the latter makes ldd perform relocations for both data objects and functions. In both cases, the tool reports missing ELF objects (if any).

    ldd -d
    ldd -r

    Q5. How get help on ldd?

    The --help command line option makes ldd produce useful usage-related information for the tool.

    ldd --help

    How get help on ldd

    Conclusion

    Agreed, ldd doesn't fall into the category where tools like cd, rm, and mkdir fit in. That's because it's built for a specific purpose, and it does what it promises. The utility offers limited command line options, and we've covered most of them here. To know more, head to ldd's man page.

  • 相关阅读:
    利用jquery操作select下拉列表框
    Head.First.ObjectOriented.Design.and.Analysis《深入浅出面向对象的分析与设计》读书笔记(四)
    关于设计的度的一点小认识
    工厂方法模式
    Head.First.ObjectOriented.Design.and.Analysis《深入浅出面向对象的分析与设计》读书笔记(三)
    .Net下面的AOP[转]
    PetShop之ASP.NET缓存
    简单工厂模式
    C# 数据结构 单链表反转
    C# 面试算法
  • 原文地址:https://www.cnblogs.com/taouu/p/14674512.html
Copyright © 2011-2022 走看看