so so.*.*
转自:http://unix.stackexchange.com/questions/5719/linux-gnu-gcc-ld-version-scripts-and-the-elf-binary-format-how-does-it-wor/10317#10317
First of all, ELF is the specification use by Linux for executable files (programs), shared libraries, and also object files which are the intermediate files found when compiling software. Object files end in .o, shared libraries end with .so followed by zero or more digits separated by periods, and executable files don't have any extension normally.
There are typically three forms to name a shared library, the first form simply ends in .so. For example, a library called readline is stored in a file called libreadline.so and is located under one of /lib, /usr/lib, or /usr/local/lib normally. That file is located when compiling software with an option like -lreadline. -l tells the compiler to link with the following library. Because libraries change from time to time, it may become obsolete so libraries embed something called a SONAME. The SONAME for readline might look like libreadline.so.2 for the second version major version of libreadline. There may also be many minor versions of readline that are compatible and do not require software to be recompiled. A minor version of readline might be named libreadline.so.2.14. Normally libreadline.so is just a symbolic link to the most recent major version of readline, libreadline.so.2 in this case. libreadline.so.2 is also a symbolic link to libreadline.so.2.14 which is actually the file being used.
The SONAME of a library is embedded inside the library file itself. Somewhere inside the file libreadline.so.2.14 is the string libreadline.so.2. When a program is compiled and linked with readline, it will look for the file libreadline.so and read the SONAME embedded in it. Later, when the program is actually executed, it will load libreadline.so.2, not just libreadline.so, since that was the SONAME that was read when it was first linked. This allows a system to have multiple incompatible versions of readline installed, and each program will load the appropriate major version it was linked with. Also, when upgrading readline, say, to 2.17, I can just install libreadline.so.2.17 alongside the existing library, and once I move the symbolic link libreadline.so.2 from libreadline.so.2.13 to libreadline.so.2.17, all software using that same major version will now see the new minor update to it.
随机推荐
- 【awk】用awk将Fasta文件序列变成一行
awk: awk '/^>/&&NR>1{print "";}{ printf "%s",/^>/ ? $0" &q ...
- MySQL触发器在建立时,报语法错的问题
delimiter $$ create trigger trg_delete_on_users before DELETE on users for each row begin delete fro ...
- mac pycharm快捷键
Mac键盘符号和修饰键说明 ⌘ Command ⇧ Shift ⌥ Option ⌃ Control ↩︎ Return/Enter ⌫ Delete ⌦ 向前删除键(Fn+Delete) ↑ 上箭头 ...
- 【转载】SSH协议及其应用
原文作者:阮一峰 链接: http://www.ruanyifeng.com/blog/2011/12/ssh_remote_login.html http://www.ruanyifeng.com/ ...
- Git学习笔记——分支
分支用法很多,比如bug修复,协作管理,这里只简单介绍我在工作中用到的协作模式. 场景:我自己开发独立功能,在本地为自己创建一个分支就叫localbranch吧,甭管master到哪了,我只管开发我的 ...
- 【新特性】JDK1.8
一.简介 毫无疑问,Java 8是Java自Java 5(发布于2004年)之后的最重要的版本.这个版本包含语言.编译器.库.工具和JVM等方面的十多个新特性.在本文中我们将学习这些新特性,并用实际的 ...
- js 空语句
不写就行了 ){}
- linux 修改普通用户的 max user process
因为出现 fork: retry: No child processes 问题 , google了一下 , 大家说是要去修改 /etc/security/limits.conf 文件 , 然后我用r ...
- Android之人脸识别
**前言** 人工智能时代快速来临,其中人脸识别是当前比较热门的技术,在国内也越来越多的运用,例如刷脸打卡.刷脸App,身份识别,人脸门禁等等.当前的人脸识别技术分为WEBAPI和SDK调用两种法方式 ...
- Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: ElasticsearchParseException[malformed, expected end of settings but encountered additional conte
D:\elasticsearch\elasticsearch-2.4.0\bin>elasticsearchException in thread "main" Settin ...