“没有可用的版本信息"是什么意思?来自linux动态链接器的错误是什么意思? [英] What does the "no version information available" error from linux dynamic linker mean?

查看:13
本文介绍了“没有可用的版本信息"是什么意思?来自linux动态链接器的错误是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的产品中,我们发布了一些动态链接到libpam"等系统库的 linux 二进制文件.在某些客户系统上,当程序运行时,我们在 stderr 上收到以下错误:

In our product we ship some linux binaries that dynamically link to system libraries like "libpam". On some customer systems we get the following error on stderr when the program runs:

./authpam: /lib/libpam.so.0: no version information available (required by authpam)

应用程序运行良好并执行动态库中的代码.所以这不是一个致命错误,它实际上只是一个警告.

The application runs fine and executes code from the dynamic library. So this is not a fatal error, it's really just a warning.

我认为当系统安装的库缺少我们的可执行文件期望的东西时,这是来自动态链接器的错误.我对动态链接过程的内部了解不多......并且谷歌搜索该主题并没有多大帮助.:(

I figure that this is error comes from the dynamic linker when the system installed library is missing something our executable expects. I don't know much about the internals of the dynamic linking process ... and googling the topic doesn't help much. :(

有谁知道是什么导致了这个错误?...我如何诊断原因?...以及我们如何更改可执行文件以避免此问题?

Anyone know what causes this error? ... how I can diagnose the cause? ... and how we could change our executables to avoid this problem?

更新:客户升级到最新版本的debiantesting",出现同样的错误.所以它不是一个过时的 libpam 库.我想我想了解链接器在抱怨什么?如何调查根本原因等?

Update: The customer upgraded to the latest version of debian "testing" and the same error occurred. So it's not an out of date libpam library. I guess I'd like to understand what the linker is complaining about? How can I investigate the underlying cause, etc?

推荐答案

没有可用的版本信息"表示共享对象上的库版本号较低.例如,如果您构建二进制文件的机器上的 major.minor.patch 编号为 7.15.5,而安装机器上的 major.minor.patch 编号为 7.12.1,则 ld 将打印警告.

The "no version information available" means that the library version number is lower on the shared object. For example, if your major.minor.patch number is 7.15.5 on the machine where you build the binary, and the major.minor.patch number is 7.12.1 on the installation machine, ld will print the warning.

您可以通过使用与目标操作系统随附的共享对象版本相匹配的库(标头和共享对象)进行编译来解决此问题.例如,如果您要安装到 RedHat 3.4.6-9,您不想在 Debian 4.1.1-21 上编译.这是大多数发行版提供特定 Linux 发行版号的原因之一.

You can fix this by compiling with a library (headers and shared objects) that matches the shared object version shipped with your target OS. E.g., if you are going to install to RedHat 3.4.6-9 you don't want to compile on Debian 4.1.1-21. This is one of the reasons that most distributions ship for specific linux distro numbers.

否则,您可以静态链接.但是,您不想使用 PAM 之类的东西来执行此操作,因此您希望实际安装一个与客户的生产环境匹配的开发环境(或者至少安装并链接到正确的库版本.)

Otherwise, you can statically link. However, you don't want to do this with something like PAM, so you want to actually install a development environment that matches your client's production environment (or at least install and link against the correct library versions.)

重命名 .so 文件(用版本号填充它们)的建议源于共享对象库不使用版本符号的时代.所以不要指望使用 .so.n.n.n 命名方案会有所帮助(很多 - 如果您的系统已被破坏,它可能会有所帮助.)

Advice you get to rename the .so files (padding them with version numbers,) stems from a time when shared object libraries did not use versioned symbols. So don't expect that playing with the .so.n.n.n naming scheme is going to help (much - it might help if you system has been trashed.)

您的最后一个选项将使用自定义链接脚本使用具有不同次要版本号的库进行编译:http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-linker/scripts.html

You last option will be compiling with a library with a different minor version number, using a custom linking script: http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-linker/scripts.html

为此,您需要编写一个自定义脚本,并且您需要一个自定义安装程序,该安装程序使用自定义脚本针对您客户的共享对象运行 ld.这要求您的客户在其生产系统上安装 gcc 或 ld.

To do this, you'll need to write a custom script, and you'll need a custom installer that runs ld against your client's shared objects, using the custom script. This requires that your client have gcc or ld on their production system.

这篇关于“没有可用的版本信息"是什么意思?来自linux动态链接器的错误是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆