Introduction to the LDD command
(2007-08-29 09:21:42)
Reproduced
| Tags: Linux Learning |
Category: learning Communication |
1. when making your own distribution, it is often necessary to determine which shared library files are required to support a particular command to ensure that the specified command can be run reliably within a separate system;
It can be implemented under the Linux environment by the LDD command, under the terminal:
The Ldd/bin/ls//LDD command typically uses the "-V" or "--verbose" option to display as much detail as possible of the dependent dynamic Connection library.
You can get a list of related shared library files for the/BIN/LS command:
libtermcap.so.2 =/lib/libtermcap.so.2 (0x4001c000) libc.so.6 =/lib/libc.so.6 (0x40020000)/lib/ld-linux.so.2 =/lib/ld-linux.so.2 (0x40000000) |
Note: in the results of the LDD command printing, the left side of "= =" indicates the name of the shared library that the program needs to connect to, and to the right represents the location of the corresponding shared library found by the Linux shared library system in the file system. By default, the/etc/ld.so.conf file contains a default shared library search path.
2. godson Computer updates the library file, often cause some software is not available, you can use the LDD command to check the software needs those shared library support, such as: previously installed apt-get install Devscripts software is installed with a lot of updated libraries, resulting in openoffice unusable, you can use the command:
#ldd/opt/openoffice.org2.0/program/soffice.bin
View the shared library files on which they depend.
Knowledge Points:
1, if the use of the LDD command does not find the corresponding shared library file and its specific location, it may be caused by two situations:
The shared library is not installed in the system;
The shared library is saved in a location other than the search path listed in the/etc/ld.so.conf file.
Often, many open-source programs or libraries will install themselves to the appropriate location in the /usr/locaL directory (for example,/usr/local/bin or/usr/local/lib) by default, to differentiate themselves from the system's own program or library of functions. Many Linux system/etc/ld.so.conf files do not include/usr/local/lib in the default file. As a result, it is often possible to have shared libraries installed, but you cannot find shared libraries. The specific solutions are as follows:
Check the /etc/ld.so.conf file, if the /usr/local/lib directory is missing, add it; Note: after modifying the /etc/ld.so.conf File or after installing a new library in the system, you need to run a command:ldconfig, which refreshes the shared library cache of the system, the /etc/ld.so.cache file. In order to reduce the library search time for Shared library systems, the shared library system maintains a cached file/etc/ld.so.cache of the shared library so name. Therefore, after you install the new shared library, be sure to run ldconfig to flush the cache.
2, using the NM command can also get the information of library functions; the NM command lists the symbol tables in a library file, which can work on both static library functions and shared library functions.
Introduction to the LDD command