【IT专家】用于构建共享库的“soname”选项是什么?

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

本文由我司收集整编,推荐下载,如有疑问,请与我司联系
用于构建共享库的“soname”选项是什么?
用于构建共享库的“soname”选项是什么?[英]What is the ‘soname’option for building shared libraries for? I learned the “Program Library HOWTO”.It mention that using soname to manage the version like follow.
我学过“程序库如何操作”。

它提到使用soname 来管理如下版本。

gcc -shared -fPIC -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0.0 foo.cln -s libfoo.so.1.0.0 libfoo.so.1ln -s libfoo.so.1 libfoo.so And I get the information that if the soname is not set. it will be equal to libfoo.so.1.0.0 ,see the answer from here.
我得到的信息是,如果soname 不是set,它将等于libfoo。

so.1。

0,从这里看到
答案。

And I find that it also can work without soname , like following
我发现它也可以在没有soname 的情况下工作,比如跟随
gcc -shared -fPIC -o libfoo.so.1.0.0 foo.c ln -s libfoo.so.1.0.0 libfoo.so.1 ln -s libfoo.so.1 libfoo.so So I think that the only one useful point is that the soname option can tell you the version of the shared library when you use readelf -d libfoo.so command to check it.
因此我认为唯一有用的一点是,当您使用readelf -d libfoo 时,soname 选项可以告
诉您共享库的版本。

命令检查一下。

What else can it do?
它还能做什么?
37
soname is used to indicate what binary api compatibility your library support.
soname 用于指示您的库支持哪些二进制api 兼容性。

SONAME is used at compilation time by linker to determine from the library file what actual target library version. gcc -lNAME will seek for libNAME.so link or file then capture its SONAME that will certainly be more specific ( ex libnuke.so links to。

相关文档
最新文档