[Change] ldd command to use the principles and

Role <br /> to view the shared libraries necessary to run the program, the program used to solve the lack of a library can not run some of the problems.

ldd command theory
1, the first ldd not an executable program, but just a shell script
2, ldd will show the executable module dependency, the principle is by setting a series of environmental variables, as follows:
When LD_TRACE_LOADED_OBJECTS environment variable is not empty, all executable code at run time, he will only display module dependency, but does not really implement the program. Or you can test in the shell terminal, as follows:
b, then the implementation of all programs, such as ls and so on, to see the program running results
3, ldd shows the work of the executable module dependency theory, the essence of this is ld-linux.so (elf dynamic library loader) to achieve. We know, ld-linux.so module will first work on the executable program modules, and access control, so when those mentioned above when the environment variable is set, ld-linux.so chosen display executable module dependency.
4, in fact, a direct implementation of the ld-linux.so modules, such as: / lib/ld-linux.so.2 - list program (which is equivalent to ldd program)

ldd command to use
(From ldd - help)
Name ldd - print shared library dependencies
Outline ldd [option] ... file ...
Description ldd output specified on the command line program or shared library needed for each shared library.
- Version
Print the version number of ldd

-V - verbose
Print all information, including, for example symbol version information

-D - data-relocs
Implementation of the symbolic re-deployment, and report missing target object (only ELF format applicable)

-R - function-relocs
Implementation on the target object and function of re-deployment, and report the lack of objective targets and function (ELF format only applicable)

- Help usage information


The standard version of ldd and glibc2 provided with. Libc5 and old versions of previously provided, in some systems there. In libc5 version does not support long options. On the other hand, glibc2 version does not support the-V option, only the equivalent - version option.
If the command line in a given library name contains '/', the libc5 version of this program will use his name as a library; otherwise he will search for libraries in the standard position. Run a current directory of shared libraries, add prefix "./"。


ldd does not work in the a.out format shared library.
ldd can not work in some very old a.out programs, these programs support the ldd issue before the compiler to create. If this type of program you use ldd, program will try to argc = 0 operating mode, and the results unpredictable

分类:OS 时间:2010-08-25 人气:175
blog comments powered by Disqus


  • linux shell variable environment variable command not found a solution 2010-07-14

    linux shell variable environment variable command not found a solution In Ubuntu, there are several files you can set the environment variable 1, / etc / profile: In the log, the operating system to use when customizing the user environment, the firs

  • environment variable settings ubuntu 2010-07-14

    Transfer from Small soubo customer http://blog.csdn.net/xiaosu_521/archive/2008/03/09/2160458.aspx Environment variable configuration file In Ubuntu, there are several files you can set the environment variable 1, / etc / profile: In the log, the ope

  • Environment variable configuration file 2010-09-16

    Environment variable configuration file If you want to be a path to $ PATH, you can do something like this: 1. Console: $ PATH = "$ PATH: / my_new_path" (closed shell, will restore the PATH) 2. Modify the profile file: $ Vi / etc / profile Insid

  • Under Linux environment variable settings 2011-05-13

    1 Introduction In the linux system, if you download and install the application, is likely to type its name in the emergence of "command not found" prompt content. If the target every time to the installation folder, find the executable file to

  • Ubuntu-depth understanding of the environment variable 2011-05-17

    Transfer: http://blog.csdn.net/xiaosu_521/archive/2008/03/09/2160458.aspx Very well written article, so I have ubuntu's understanding of the environment variable, thanks to the author. Environment variable configuration file In Ubuntu there are sever

  • Ubuntu environment variable method 2011-08-28

    Environment variable configuration file In Ubuntu there are several files you can set the environment variable 1, / etc / profile: when you log on, customize the user environment operating system to use when the first file, the file for each user to

  • Unix environment variable settings 2010-03-31

    Unix environment variable settings [change] We install the system software in Linux when the system environment variables frequently encountered configuration problems. What is environment variables? How to customize the environment variables? I will

  • How to set the JDK environment variable 2010-06-12

    Click in turn: "My Computer" - (right) "Properties" - "Advanced" - "environment variable", the pop-up Windows "environment variable" configuration card. In the "System Variables" column, the impl

  • linux java program run time service crond 2010-03-24

    crontab to run java programs on your java program in the / root / example directory below named Test.java Test.java says: public class Test ( public static void main (String args []) ( System.out.println ("ok"); ) ) However, because the relevant

  • Configuring tomcat to run the environment 2010-08-09

    Question: Configuring tomcat to run today's environment when the below problem The CATALINA_HOME environment variable is not defined correctly This environment variable is needed to run this program Then added to the CATALINA_HOME environment variabl

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 闽ICP备15018612号

processed in 0.365 (s). 12 q(s)