Linux so library generation (1), linuxso library generation

Source: Internet
Author: User

Linux so library generation (1), linuxso library generation

Dear!

Post a public version first. I hope to understand it word by word. It is helpful!

$ Gcc-shared-Wl,-soname, libhello. so.1-o libhello. so.1.0 hello. o create two symbolic connections: $ ln-s libhello. so.1.0 libhello. so.1 $ ln-s libhello. so.1 libhello. so, a dynamic Connection Library of libhello is generated. The most important thing is to pass the gcc-shared parameter so that it is generated as a dynamic library rather than a common execution program. -Wl indicates that the following parameter is-soname, and libhello. so.1 is directly transmitted to the connector ld for processing. In fact, each database has a soname. When the connector finds that the library It is searching for has such a name, the connector will embed the soname into the binary file in the link, instead of the actual file name it is running, during program execution, the program will find the file with the soname name, rather than the file name of the library. In other words, soname is the identification mark of the library. The main purpose of this operation is to allow coexistence of library files of multiple versions in the system. It is customary that libxxxx is usually the same as soname when naming library files. so. major. in minor, xxxx indicates the database name, major indicates the main version number, and minor indicates the minor version number.

Do you understand?

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.