Differences between static and dynamic libraries, applications-ldconfig and ldd

Source: Internet
Author: User
Differences between the static function library and dynamic function library, application-ldconfig, ldd1, and function library static and dynamic: a. static function library: sub-file name. a is to include the entire program, the program will be relatively large, upgrade trouble www.2cto. comb, dynamic function library: sub-file name... differences between the static function library and dynamic function library, applications-ldconfig and ldd 1. differences between the static and dynamic functions Library: a. static function library: sub-file name. a is to include the entire program, the program will be relatively large, upgrade trouble www.2cto.com B, dynamic function library: Sub file name. so, the link method is flexible, the program is small, the main push 2, the dynamic function library into the memory to improve the speed: first, we must in/etc/ld. so. in the conf file, write 'Directory of the dynamic library to be read into the cache '. Note that it is a directory rather than a file. Then, use the ldconfig file to run/etc/ld. so. conf data is read into the cache, and the data is recorded in/etc/ld. so. Cache this file! Example of www.2cto.com: suppose that the library of my MySQL database is in/usr/lib/mysql, how do I read it into the cache? [Root @ www ~] # Vi/etc/ld. so. confinclude ld. so. conf. d/*. conf/usr/lib/mysql <= This line is added! [Root @ www ~] # Ldconfig <= no information is displayed on the screen. Don't be too nervous! Normal! [Root @ www ~] # Ldconfig-p <= List all the current library information (in/etc/ld. so. cache !) 3. what kind of dynamic library is called by a program and what other libraries related to a dynamic library are: [root @ www ~] # Ldd [-vd] [filename] option and parameter:-v: list all content information;-d: show the link information that has been lost again! -R: show ELF-related error content! Example 1: Find the library information for the/usr/bin/passwd file [root @ www ~] # Ldd/usr/bin/passwd .... (omitted above ).... libaudit. so.0 =>/lib/libaudit. so.0 (0x00494000) <= SELinux libselinux. so.1 =>/lib/libselinux. so.1 (0x00101000) <= SELinux libc. so.6 =>/lib/libc. so.6 (0x00b99000) libpam. so.0 =>/lib/libpam. so.0 (0x004ab000) <= PAM module .... (omitted below ).... # Didn't the preface always mention that passwd uses pam modules! How do you know? # Use ldd to check this file and see libpam. so? This is the form Library example 2 provided by pam: Find Other form libraries related to the/lib/libc. so.6 function! [Root @ www ~] # Ldd-v/lib/libc. so.6/lib/ld-linux.so.2 (0x00ab3000) linux-gate.so.1 => (0x00636000) Version information: <= use the-v option to add additional Version information! /Lib/libc. so.6: ld-linux.so.2 (GLIBC_PRIVATE) =>/lib/ld-linux.so.2 ld-linux.so.2 (GLIBC_2.3) =>/lib/ld-linux.so.2 ld-linux.so.2 (GLIBC_2.1) =>/lib/ld-linux.so.2
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.