Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: cannot execute binary file

  1. #1
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,126
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question cannot execute binary file

    Hi all I have an old Unix program that I cant see, to run on my modern linux box getting the error: ./atomtv: cannot execute binary file

    Are there any tricks to getting a binary intended for Unix to run in linux?
    ~Conradin~

  2. #2
    Join Date
    Sep 2011
    Beans
    457

    Re: cannot execute binary file

    well if windows 7 is based on ms dos, then Linux is based on *nix, it's based on Unix kernel file system. I'm not too familiar with Unix, but it's sad to say so, because unix = linux with different gui, or perhaps it's head less. So I wouldn't know the answer to your question.

    what is atom tv? how did it run on Unix? it gui based or command line based to execute? If it won't work on the binary, then it may not run at all. If it's more lower code level based to execute, maybe there is a way to fix it. If not, and it runs on higher level code, maybe there isn't a way to fix it. If the binary isn't recognised, it means the file isn't executing on the lowest level code possible to run. It just may not be supported.

  3. #3
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: cannot execute binary file

    Linux programs can often be compiled from the source code to work in various computers. At least if there is not GUI. And for PCs the compiled code is portable, but with restrictions, for example 64-bit code cannot be run on a 32-bit cpu. PC code does not work on a power pc, but there is an ubuntu version for power pc.

    An old program from Unix was probably compiled for a completely different kind of cpu, and in that case, it won't work in a PC.

  4. #4
    Join Date
    Feb 2012
    Beans
    35

    Re: cannot execute binary file


  5. #5
    Join Date
    Jan 2012
    Beans
    342

    Re: cannot execute binary file

    Quote Originally Posted by conradin View Post
    [...] Are there any tricks to getting a binary intended for Unix to run in linux?
    It is unlikely. Even if it were compiled on a early Minix, Linux, or Redhat Linux 6 for that matter, then the versions of the libraries it linked to (glibc, libreadline, etc) would nolonger be avaialble on your system.

    AIX, HP-AUX, Tru64, IRIX, Solaris, etc, have their own versions of libc, and many other libraries, so if its compiled on anything other than a GNU based system it is even less likely.

    You might get some idea of the buildhost by running 'file atomtv', running 'strings atomtv | less' might also give you some useful information (runtime libraries, copyright info, --help, etc). If you have gdb installed that would no doubt spit out its reasons for exiting.

    I wouldn't hold your breath .. nor place any wagers

    HTH ..

  6. #6
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,510
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: cannot execute binary file

    Quote Originally Posted by conradin View Post
    Hi all I have an old Unix program that I cant see, to run on my modern linux box getting the error: ./atomtv: cannot execute binary file

    Are there any tricks to getting a binary intended for Unix to run in linux?
    1. Having the Execute bit set helps.
    2. If it is 32-bit and you are trying to run it on a 64-bit system, then you will need the appropriate libs.
    3. The post above this has the most likely issues.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  7. #7
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,126
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: cannot execute binary file

    The original binary is for IRIX computers. I read that libygl could help these problems, but it even with the ygl library installed, the binary will not execute.
    ~Conradin~

  8. #8
    Join Date
    Apr 2007
    Location
    New Zealand
    Beans
    894
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: cannot execute binary file

    conradin, we can use the file utility to tell us detailed information about the file.
    can you please tell us the output of the following?
    Code:
    file ././atomtv

    Also, we can use ptrace to follow execution of a file. I'm not too sure if it'll work but worth giving it a shot (you may need to install ptrace)
    Code:
    ptrace ./atomtv
    For example I get this on some different files in my system:

    Code:
    file /bin/ls
    /bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
    Code:
    file /bin/busybox 
    /bin/busybox: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.15, stripped
    Code:
    file ~/.wine/drive_c/windows/notepad.exe 
    ~/.wine/drive_c/windows/notepad.exe: PE32 executable for MS Windows (GUI) Intel 80386 32-bit
    Brown doesn't suck. And neither does wood. Download Woody. A Metacity theme.
    Note: the rm command deletes stuff! Don't be tricked into running malicious scripts. If in doubt, ask!!

  9. #9
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,126
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: cannot execute binary file

    Code:
    file atomtv
    atomtv: ELF 32-bit MSB executable, MIPS, MIPS-I version 1 (SYSV), dynamically linked (uses shared libs), stripped
    I dont have, not could I find ptrace. But I assume its like strace.
    Code:
    $ strace ./atomtv 
    execve("./atomtv", ["./atomtv"], [/* 38 vars */]) = -1 ENOEXEC (Exec format error)
    dup(2)                                  = 3
    fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
    fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
    mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb78d6000
    _llseek(3, 0, 0xbfbaa228, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
    write(3, "strace: exec: Exec format error\n", 32strace: exec: Exec format error
    ) = 32
    close(3)                                = 0
    munmap(0xb78d6000, 4096)                = 0
    exit_group(1)                           = ?
    can mipps programs be made to work in ubuntu?
    ~Conradin~

  10. #10
    Join Date
    Jan 2008
    Beans
    44
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: cannot execute binary file

    I think it goes deeper than that, it's more a case of MIPS binaries are not going to be able to be run by your CPU, without some sort of emulator. It's a completely different CPU from x86 processors, and not binary compatible. Don't know if this is of some help as a starting point - http://www.linux-mips.org/wiki/Emulators I don't even know if this is possible, but if you could install SGI IRIX in an emulator that would probably be the best chance of getting the program working.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •