Edit for people looking this up in the future: My understanding right now is the "No such file or directory" is misleading. If you have an elf, you run it by chmod a+x and ./programname.elf. The reason it failed on my system is that elf can mean(and does in this case), that you have a dynamically linked executable. Because the SDK I used linked dynamically, the source code for the 3rd party functions used by the SDK are not built into the elf. A dynamic linked executable simply looks for all the required includes when it is run, a static linked executable has all the required code written into the binary when it is compiled. The solution to my problem seems to be either figure out how to make the SDK compile my program statically, or figure out how to make a statically linked library containing the relevant functions I need and build my program natively on my target platform using that.
I try to run an elf with bash./program.elf, but get response "cannot execute binary file".
Running file program.elf gives
file.elf: ELF 32-bit LSB executable, ARM, EABI5 version 1(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped
Running uname -a gives
Linux analog 3.19.0-g7f929ec #1 SMP PREEMPT Thu Sep 3 18:06:48 EEST 2015 armv71 armv71 armv71 GNU/Linux
Both say ARM, so why does this program not work?
At someone's suggestion, here is readelf-A ./program.elf
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_FP_arch: VFPv3
Tag_Advanced_SIMD_arch: NEONv1
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_rounding: Needed
Tag_ABI_FP_denomal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
readelf -A ./program.elf
info to verify. Is there more to the error than "cannot execute binary file"? – jc__ Jul 12 '16 at 18:08bash ./program.elf
? The elf file is NOT a bash script. Dont run it through the bash interpreter. It is an elf file./program.elf
. Assume execute bit set.chmod a+x ./program.elf
. – jc__ Jul 12 '16 at 18:36/path/to/program.elf
. – jc__ Jul 12 '16 at 18:44./program.elf
says “No such file or directory” but the file exists, see http://unix.stackexchange.com/questions/11000/no-such-file-or-directory-lies-on-optware-installed-binaries If neither jc__'s comment nor that answer solves your problem, edit your question to update it with everything you wrote in the comments, and tell us precisely what OS your system is running (which distribution, which architecture, etc.), what processor it has, and how you compiled that program (what exact compiler, what compiler flags). – Gilles 'SO- stop being evil' Jul 12 '16 at 23:27