我当时在做一个应用程序,做了一些修改,现在它甚至不能运行了。我已经恢复了更改,重新构建了整个应用程序,但仍然没有任何进展。我不明白这个错误是怎么发生的?我删除了.o文件,做了一个全新的构建,但它仍然不起作用。我没有更改构建设置,我只修改了一些.cpp文件。
如何解决可执行文件不再可执行的问题?
ls -l
-rwx--x--x 1 root root 6344081 Sep 16 23:35 z*
gdb输出
[root@ipfrmk /]# gdb z
GNU gdb (GDB) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-buildroot-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
"/z": not in executable format: File truncated
(gdb) run z
Starting program: z
No executable file specified.
Use the "file" or "exec-file" command.
This与我的问题无关,因为我不会从任何类型的32位更改为64位,反之亦然。
我看到的大多数问题都是关于“文件格式不被识别”或某种截断的核心文件问题,这些问题不适用于我的问题,我不相信.
文件输出
[root@ipfrmk /]# file z
z: ERROR: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), statically linked, interpreter lib/ld-linux-armhf.so.3 error reading (Invalid argument)
有足够的文件系统空间可用(应用程序约63 of )
Filesystem Size Used Available Use% Mounted on
/dev/root 487.8M 189.9M 272.9M 41% /
我检查了构建机器和设备上的md5sum匹配。
构建VM
# md5sum /app/z
e901ef35e43d91545fb9d968c078dce2 /app/z
设备机
[root@ipfrmk /]# md5sum z
e901ef35e43d91545fb9d968c078dce2 z
发布于 2021-12-22 05:06:21
更新:
以前的猜测已经消除:文件系统在构建主机和目标主机之间有足够的空间和md5sum
匹配。
这只留下了一种可能的可能性:构建工具链在某种程度上已经损坏,并产生了损坏的二进制文件。
特别是,我错过了输出的这一部分:
z: ERROR: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), \
statically linked, interpreter lib/ld-linux-armhf.so.3 error reading (Invalid argument)
二进制文件不能同时是statically linked
和ld/ld-linux-armhf.so.3
解释器。解释器应该是绝对路径。
先前的答复:
我看到的大多数问题都是关于“文件格式不被识别”或某种截断的核心文件问题,这些问题不适用于我的问题,我不相信.
造成此错误的两个常见原因是:
ftp
传输,导致文件损坏.验证例如构建主机上的md5sum
和目标匹配将消除这两种可能性。
https://stackoverflow.com/questions/70442352
复制相似问题