CHAPTER22: Source Code and Tarball (3)-Management of function library

Source: Internet
Author: User

I. Two types of function libraries

(1) Static function library

Extension LIBXXX.A

Integrated into the execution program at compile time. So the file will be relatively large.

can be executed independently.

If the function library is upgraded, the entire program is recompiled.

(2) Dynamic function library

Extension libxxx.so

Executable files are read only when they are used in libraries, and the files are relatively small.

cannot be executed independently. The directory of the library cannot be changed.

After the library upgrade, the executable does not have to be recompiled. So it's easy to upgrade.

At present, Linux distribution generally use the dynamic function library, because the upgrade is convenient. Most libraries are placed in/usr/lib,/lib below, and many functions are provided by kernel, which is put in/lib/ Modules. The libraries of different versions of the kernel are quite dissimilar, so the kernel 2.4 system does not want to upgrade the kernel to 2.6. So, it's easy because the libraries are different and many software cannot be used.

Two. How to load libraries into memory to increase performance

Using Ldconfig and/etc/ld.so.conf, you can load commonly used libraries into memory to improve performance.

Three. How to determine what dynamic function library an executable program contains

You can use the LDD command, as we want to know what dynamic function library/usr/bin/passwod This program uses, so

You can see the PAM (authentication) module in it. Let's find out/lib/libc.so.6 this function-related library (note the path to it)

Four. Verify the correctness of the software

Only explains how the validation is done.

or using NTP as an example. The MD5 of the official website is

Verify after download as

Both are the same and therefore safe.

CHAPTER22: Source Code and Tarball (3)-Management of function library

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.