sh – Schrödinger的档案

sh – Schrödinger的档案,第1张

概述我对以下命令序列感到困惑. sh-4.2$pwd/home/willardsh-4.2$ls -l f-rwxr-xr-x 1 willard users 59116 Jan 23 14:54 fsh-4.2$file ff: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (use 我对以下命令序列感到困惑.

sh-4.2$pwd/home/willardsh-4.2$ls -l f-rwxr-xr-x 1 willard users 59116 Jan 23 14:54 fsh-4.2$file ff: ELF 32-bit LSB executable,Intel 80386,version 1 (SYSV),dynamically linked (uses shared libs),for GNU/linux 2.6.15,BuildID[sha1]=0xea0e08ff2b5a062698d45b78177acdd6bf140d1f,strippedsh-4.2$./fsh: ./f: No such file or directorysh-4.2$strace ./fexecve("./f",["./f"],[/* 32 vars */]) = -1 ENOENT (No such file or directory)write(2,"strace: exec: No such file or di"...,40strace: exec: No such file or directory) = 40exit_group(1)                           = ?+++ exited with 1 +++sh-4.2$ls -l f-rwxr-xr-x 1 willard users 59116 Jan 23 14:54 fsh-4.2$uname -alinux xdat10 3.6.2-1-ARCH #1 SMP PREEMPT Fri Oct 12 23:58:58 CEST 2012 x86_64 GNU/linux

这怎么可能?

解决方法@H_502_17@ 我发现有人有同样的问题(有相关解释)

Running 32bit binary on a 64bit system

引用最重要的句子:

This situation often arises when you try to run a binary for the right
system (or family of systems) and superarchitecture but the wrong
subarchitecture. Here you have ELF binarIEs on a system that expects
ELF binarIEs,so the kernel loads them just fine. They are i386
binarIEs running on an x86_64 processor,so the instructions make
sense and get the program to the point where it can look for its
loader. But the program is a 32-bit program (as the file output
indicates),looking for the 32-bit loader /lib/ld-linux.so.2,and
you’ve presumably only installed the 64-bit loader
/lib64/ld-linux-x86-64.so.2 in the chroot.

You need to install the 32-bit runtime system in the chroot: the
loader,and all the librarIEs the programs need. On Debian amd64,the
32-bit loader is in the libc6-i386 package. You can install a bigger
set of 32-bit librarIEs by installing ia32-libs.

我打赌有更好的方法来验证这一点,但我会尝试执行

ldd ./f

并在输出中搜索需要加载器的exec’it

总结

以上是内存溢出为你收集整理的sh – Schrödinger的档案全部内容,希望文章能够帮你解决sh – Schrödinger的档案所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1018824.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存