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?