0

I have an executable file from an embedded device running linux. The device is running on an ARMv5TE Intel PXA255. Since that platform is long obsolete, I would like to run the program on a more modern and cheap Atheros AR9331 running OpenWrt 12.09. Following common sense and some info I found on the net, I thought that I could just chmod +X prog1 the file and then run it. Unfortunately, doing that does nothing... The program is not recognized: at the prompt, if I write the first characters and press tab nothing happens, if I write the file name and press enter I get /bin/ash: prog1: not found, and of course if I write ./prog1 I get this error: ./prog1: line 1: syntax error: unexpected word (expecting ")")

more info:

-I verified that the header is 0x7F 'E' 'L' 'F'

-The program seems to decompile correctly on IDA

Am I getting these errors because the platforms are too different? What am I doing wrong/what can I do to run this program? I don't have sources.

MGG
  • 93
  • 1
  • 9
  • 2
    ELF is a container format. It does not mean that the instruction set specifics, ABI, or shared library dependencies are necessarily compatible. As a starting point you could use tools like readelf or objdump to examine this file in comparison to sample executables from the new system. – Chris Stratton Feb 08 '14 at 18:50
  • 1
    The first check would be to run [file](http://unixhelp.ed.ac.uk/CGI/man-cgi?file) on your old binary and compare its output with any binary on OpenWrt. – yegorich Feb 08 '14 at 22:09
  • 1
    The older binary will be compiled with a different ABI. For instance soft vs hard float, etc. See [ArmV5 FTD2xx on ArmV7](http://stackoverflow.com/questions/15306447/arm-v5-shared-library-ftd2xx-on-arm-v7-platform-hard-vs-soft-float-issue). – artless noise Feb 08 '14 at 22:55
  • Thank you @Chris, you made it extremely clear using 3 words, while I got the exact opposite impression while reading the wikipedia article on ELF. The `file` command returns, for the original program: `prog1: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), for GNU/Linux 2.0.0, stripped` and for an OpenWrt program: `opkg: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), corrupted section header size`. – MGG Feb 09 '14 at 13:47
  • So I think I'm seeing the problem now, and I guess that I will not be able to run that program without recompiling it... Am I right? – MGG Feb 09 '14 at 13:52
  • 2
    Yes, a lot of routers are MIPS not ARM. Needless to say that is not going to work. – Chris Stratton Feb 09 '14 at 13:53

0 Answers0