Linux glibc: elf 文件 OS ABI 无效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7647818/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 06:29:25  来源:igfitidea点击:

glibc: elf file OS ABI invalid

linuxlinux-kernelglibcabi

提问by Kapil

downloaded and compiled glibc-2.13. when i try to run a sample C program which does a malloc(). I get following error elf file OS ABI invalid

下载并编译 glibc-2.13。当我尝试运行执行 malloc() 的示例 C 程序时。我收到以下错误 elf 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

任何人都可以通过我的任何有助于解决此问题的指针。请注意我的内核版本是 linux-2.6.35.9

采纳答案by mkj

It's not your kernel version that's the problem.

这不是您的内核版本的问题。

The loader on your system does not support the new LinuxABI. Until relatively recently, Linux ELF binaries used the System VABI. Recently, in support of STT_GNU_IFUNC, the LinuxABI was added. You would have to update your systemC library to have a loader that support STT_GNU_IFUNC, and then it will also recognize ELF objects with the LinuxABI type.

您系统上的加载程序不支持新的LinuxABI。直到最近,Linux ELF 二进制文件才使用System VABI。最近,为了支持 STT_GNU_IFUNC,Linux添加了ABI。您必须更新您的系统C 库以获得支持 STT_GNU_IFUNC 的加载程序,然后它还将识别具有LinuxABI 类型的ELF 对象。

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.

如果您关心,请参阅Dave Miller 在 STT_GNU_IFUNC for Sparc 上的博客条目(已存档),以了解 STT_GNU_IFUNC 的作用。

回答by cyberzx

It is possible your glibc was built with the --enable-multiarchflag that forced using ifunc and new LINUX ABI

您的 glibc 可能是使用--enable-multiarch强制使用 ifunc 和新的 LINUX ABI的标志构建的

回答by Oliver R.

From what I can tell is that --enable-multiarchis the default setting and you should disable it by setting --enable-multiarch=no.

据我所知,这--enable-multiarch是默认设置,您应该通过设置禁用它--enable-multiarch=no

回答by msb

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 invaliderror 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.

如果您从较新的系统中接触到加载程序,您也许可以使用它来使其工作。但是,无论您的程序走到哪里,您都必须随身携带装载机。您可以按照此处的说明编译程序以使用该加载程序,也可以编译您的程序并稍后使用 patchelf 对其进行修补,这与我在此处提到的方式类似。OS ABI invalid通过从其他地方复制 ld-2.15.so,我能够运行一个程序,该程序在具有 ld-2.5.so 的 linux 2.6.18(比您的旧)上给我错误。

NOTE: do NOToverwrite your system ld*.so or ld-linux. ;-/

注意:不要覆盖您的系统 ld*.so 或 ld-linux。;-/