【发布时间】:2022-01-18 07:28:22
【问题描述】:
我在 linux 64 位机器上构建了一个 32 位二进制文件并尝试运行。
它因错误执行格式错误而失败。二进制文件不可执行。
./test
./test: Exec format error. Binary file not executable.
file test
test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=b8710a266a084a5d6e8d63a585cc6824e382a5e6, not stripped
机器详情
uname -a
Linux den03cif 4.1.12-124.52.5.el7uek.x86_64 #2 SMP Wed Jul 21 14:58:50 PDT 2021 x86_64 x86_64 x86_64 GNU/Linux
【问题讨论】:
-
那是一个旧的可执行文件。你是从哪里弄来的?程序应该做什么?你可以访问它的源代码吗?你能重建它吗?
-
您是否安装了 32 位环境才能运行 32 位应用程序?
-
以上测试是我的代码的一部分。我有一些测试运行正常,只有一个报告了这个错误。
-
您介意添加“file another_test”的输出吗?您编译“测试”的方式与其他测试不同吗? “ldd test”的输出是什么?