glibc:elf 文件操作系统 ABI 无效
下载并编译glibc-2.13。当我尝试运行一个执行 malloc() 的示例 C 程序时。我收到以下错误 elf 文件操作系统 ABI 无效
任何人都可以传递我的任何有助于解决此问题的指针。请注意,我的内核版本是 linux-2.6.35.9
downloaded and compiled glibc-2.13. when i try to run a sample C program which does a malloc(). I get following errorelf file OS ABI invalid
Can anybody please pass my any pointer helpful in resolving this issue.Please note that my kernel version is linux-2.6.35.9
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这不是你的内核版本的问题。
您系统上的加载程序不支持新的
Linux
ABI。直到最近,Linux ELF 二进制文件还使用System V
ABI。最近,为了支持 STT_GNU_IFUNC,添加了Linux
ABI。您必须更新您的系统 C 库才能拥有支持 STT_GNU_IFUNC 的加载程序,然后它还将识别具有Linux
ABI 类型的 ELF 对象。请参阅Dave Miller 在 STT_GNU_IFUNC for Sparc 上的博客文章(已存档),了解什么如果你关心的话,STT_GNU_IFUNC 可以。
It's not your kernel version that's the problem.
The loader on your system does not support the new
Linux
ABI. Until relatively recently, Linux ELF binaries used theSystem V
ABI. Recently, in support of STT_GNU_IFUNC, theLinux
ABI was added. You would have to update your system C library to have a loader that support STT_GNU_IFUNC, and then it will also recognize ELF objects with theLinux
ABI type.See Dave Miller's blog entry on STT_GNU_IFUNC for Sparc (archived) to gain an understanding of what STT_GNU_IFUNC does, if you care.
如果您从较新的系统中接触到加载程序,您也许可以使用它来使其工作。但是无论您的程序走到哪里,您都必须携带加载程序。您可以按照此处的说明编译您的程序以使用该加载程序,或者编译您的程序并稍后使用 patchelf 对其进行修补,类似于我在此处提到的方式。通过复制 ld-2.15.so,我能够在具有 ld-2.5.so 的 Linux 2.6.18(比您的版本更旧)上运行一个程序,该程序给我带来
OS ABI invalid
错误从其他地方。注意:不要覆盖您的系统 ld*.so 或 ld-linux。 ;-/
If you get your hands in the loader from a newer system, you might be able to make it work using that. But you'll have to carry the loader wherever your program go. You can either compile your program to use that loader as explained here, or compile your program and patch it later using patchelf, in a way similar to what I mention here. I was able to run a program that was giving me the
OS ABI invalid
error on a linux 2.6.18 (older than yours) that had ld-2.5.so, by copying a ld-2.15.so from somewhere else.NOTE: do NOT overwrite your system ld*.so or ld-linux. ;-/
您的 glibc 可能是使用
--enable-multiarch
标志构建的,该标志强制使用 ifunc 和新的 LINUX ABIIt is possible your glibc was built with the
--enable-multiarch
flag that forced using ifunc and new LINUX ABI据我所知,
--enable-multiarch
是默认设置,您应该通过设置--enable-multiarch=no
来禁用它。From what I can tell is that
--enable-multiarch
is the default setting and you should disable it by setting--enable-multiarch=no
.