Linux Shell Script LDD command principle and use method

Source: Internet
Author: User

1, first LDD is not an executable program, but just a shell script
2, LDD can display the dependency of the executable module, the principle is by setting a series of environment variables
As follows: Ld_trace_loaded_objects, Ld_warn, Ld_bind_now, Ld_library_version, Ld_verbose and so on. When the LD_TRACE_LOADED_OBJECTS environment variable is not empty, any executable program will display only the module's dependency while it is running, and the program does not actually execute. Or you can test it at the shell terminal, as follows:
(1) Export Ld_trace_loaded_objects=1
(2) Execute any program, such as LS, to see the results of the program running

3. LDd shows how the dependency of the executable module works, essentially through ld-linux.so (the loading of the ELF dynamic Library
To achieve the device. We know that the Ld-linux.so module works before the executable module and gets control, so when those environment variables are set, ld-linux.so chooses the dependency that shows the executable module.

4, can actually directly execute ld-linux.so module, such as:/lib/ld-linux.so.2--list program (this is equivalent to LDD program)
LDD command Usage (excerpt from LDD--help)
Name LDD-dependencies for printing shared libraries
Outline ldd [Options] ... File...
Describes the shared libraries required by the LDD output for each program or shared library specified on the command line.

Options
--version
Print the version number of the LDD
-V--verbose
Print all information, such as version information that includes symbols
-D--data-relocs
Perform symbolic re-deployment and report missing target objects (only available in elf format)
-R--function-relocs
Redeployment of target objects and functions, and reporting of missing target objects and functions (only for ELF format)
--help usage Information

Attention:

The standard version of LDD is available with GLIBC2. Libc5 is available with older versions and is still present in some systems. The long option in the LIBC5 version is not supported. On the other hand, the GLIBC2 version does not support the-V option and provides only the equivalent--version option.

If the name of the library given in the command line contains '/', the LIBC5 version of the program will use it as the library name, otherwise it will search the library in a standard location. Run a shared library under the current directory, prefixed with "./".
Error:
LDD cannot work on a shared library in the a.out format.
LDD cannot work on some very old a.out programs that were created before the compiler that supported LDD was released. If you use LDD on this type of program, the program will try to run ARGC = 0 with unpredictable results.

Http://tech.ccidnet.com/art/302/20071226/1322695_1.html

Linux Shell Script LDD command principle and use method

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.