了解 ldd 的输出

发布于 2024-09-04 11:32:50 字数 560 浏览 5 评论 0原文

我很难理解 ldd 的输出 - 特别是处理器标识符。 有问题的字符串是这个:

Shortest.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, from ']', not stripped

我有几个问题:

  • “ELF”是什么意思?我知道 Linux 二进制文件就是这样称呼的(Windows 二进制文件被称为 PE 二进制文件,“可移植可执行”二进制文件),但 ELF 不是某个东西的缩写吗?
  • LSB 是什么意思?我什至猜不到......
  • 我在那里看到字符串“Intel”,现在我认真地想知道 Linux 二进制文件的可移植性,因为 ldd 似乎期望每个二进制文件都在 intel 处理器上编译......但是如果它不是在英特尔处理器上编译的吗?或者当我尝试在不运行英特尔处理器的计算机上运行二进制文件时?
  • 为什么是“]”?我的猜测是它应该是某种链接器标识,但是“]”看起来不太像标识符...

提前致谢

I'm having a hard time understanding the output of ldd - Especially the processor identifiers.
The string in question is this one:

Shortest.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, from ']', not stripped

I have several questions about it:

  • What does "ELF" mean? I know that's what Linux binaries are called like (Windows Binaries are called PE Binaries, "Portable Executable" Binaries), but isn't ELF an abbreviation for something?
  • What does LSB mean? I can't even guess it...
  • I see the string "Intel" there, now I seriously wonder about the portability of Linux binaries, as ldd seems to expect every binary to be compiled on a intel processor... but what if it wasn't compiled on a Intel processor? Or when I attempt to run the binary on a computer that doesn't run ontop of a Intel processor?
  • Why the ']'? My guess is it should be some sort of Linker identify, but ']' doesn't look much like a Identifier...

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡淡離愁欲言轉身 2024-09-11 11:32:50

ELF 是可执行和可链接格式 - 它指定库的格式 - 请参阅可执行和可链接格式 。 LSB 指定数据的字节顺序。 Intel 386 意味着它将在与 386 兼容的所有芯片上运行,其中包括 Pentium 和 AMD 芯片,但不能在(例如)Power PC 或 IBM/370 架构上运行。

至于“]”,这个库与测试实用程序没有任何关系,不是吗? 那个。

if test -x foobar

说:或 的

if [ -x foobar ]

允许您在 shell 脚本中

ELF is executable and Linkable Format - it specifies the format of the library - see Executable and Linkable Format. LSB specifies the endianness of the data. The Intel 386 means it will run on all chips compatible with the 386, which includes Pentiums, and AMD's chips, but not (say) Power PC or IBM/370 architectures.

As for the ']', this library wouldn't have anything to do with the test utility, would it? The one that allows you to say:

if test -x foobar

or

if [ -x foobar ]

in shell scripts.

十年不长 2024-09-11 11:32:50
  • ELF
  • LSB
  • Intel:Linux 二进制文件并不意味着可移植
    accros CPU 和架构。该产品适用于支持 CUP 的设备
    运行 Intel 80386 二进制代码。
  • ']':??
  • ELF
  • LSB
  • Intel: Linux binaries are not meant to be portable
    accros CPUs and achitectures. This one is meant to be used on a CUP able
    to run Intel 80386 birary code.
  • ']': ??
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文