I'm trying to run a cross compiler on my 64 bit Ubuntu. and it results in a following error:
$ ./arm-none-eabi-gcc
bash: ./arm-none-eabi-gcc: No such file or directory
The file is here and contains some data:
$ ls -la arm-none-eabi-gcc
-rwxr-xr-x 2 alan alan 776368 Sep 26 19:36 arm-none-eabi-gcc
$ head -n 1 arm-none-eabi-gcc
ELFا4�
4 (44�4� TT�T���|�
ldd
shows there are no dependencies required:
$ ldd arm-none-eabi-gcc
not a dynamic executable
strace
also provides no additional info:
$ strace ./arm-none-eabi-gcc
execve("./arm-none-eabi-gcc", ["./arm-none-eabi-gcc"], [/* 80 vars */]) = -1 ENOENT (No such file or directory)
write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
exit_group(1) = ?
+++ exited with 1 +++
Finally I figure out that it's for a 32 bit system:
$ file arm-none-eabi-gcc
arm-none-eabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.8, stripped
Question
If the architecture of the binary is wrong why is the error so ambiguous?
I would expect analogous to the below situation where I'm trying to execute a .JPG, where the binary execution makes no sense:
$ ./DSC_0140.JPG
bash: ./DSC_0140.JPG: cannot execute binary file: Exec format error
ldd
output – TheMeaningfulEngineer Dec 14 '16 at 15:39readelf -a arm-none-eabi-gcc | grep -i interp
to look harder for what ldd didn't find – Dec 14 '16 at 16:03