1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ELF binary type "0" not known.

Discussion in 'General' started by frankgrimes97, Jun 25, 2011.

  1. frankgrimes97

    frankgrimes97 New Member

    Messages:
    4
    Thanks Received:
    0
    Hi all,

    I am trying to install a product that ships as RedHat Enterprise Linux 5 certified RPMs. After successfully installing the RPMs and trying to launch binaries, I get the following error:

    Code:
    ELF binary type "0" not known.
    ./run: Exec format error. Binary file not executable.


    I did some searching online and even tried the following:

    brandelf -t Linux run

    But then it just complains that type "3" is not known either.

    I'm running FreeBSD 8.2-RELEASE and I believe that Linux compatibility is correctly enabled as evidenced by the output of kldstat:
    Code:
    Id Refs Address            Size     Name
     1   20 0xffffffff80100000 c9fe20   kernel
     2    1 0xffffffff80da0000 202a58   zfs.ko
     3    2 0xffffffff80fa3000 4940     opensolaris.ko
     4    2 0xffffffff81022000 1cecd    linux.ko
     5    1 0xffffffff8103f000 3edb     linprocfs.ko


    I also have the linux_base-f10 port installed (tried also with linux_base-fc6 with the same results).

    Any help would be much appreciated.

    Thanks,

    Frank Grimes
     
  2. kpedersen

    kpedersen Member

    Messages:
    858
    Thanks Received:
    144
    I remember reading in the handbook that you need to rebrand the elf binary.

    I don't use Linux compatibility so perhaps someone else could explain this some more.
     
  3. matoatlantis

    matoatlantis Member

    Messages:
    534
    Thanks Received:
    76
    It is some time I've used linux-compat mode. I did make myself some notes so I know how to proceed if I need it in a future. Maybe this helps:

    Install rpm:

    # rpm --ignoreos --root /usr/compat/linux --dbpath /var/lib/rpm --nodeps --replacepkgs --install <PKG>.RPM

    Update libs:

    # /usr/compat/linux/sbin/ldconfig

    Mark the binary for the correct ABI with brandelf(1):

    # brandelf -t linux /path/to/binary
     
  4. frankgrimes97

    frankgrimes97 New Member

    Messages:
    4
    Thanks Received:
    0
    As I mentioned, I did try running brandelf -t Linux but it then simply complains that ELF binary type "3" is not known. Is there something I can check that I might have missed in setting up Linux compatibility?

    Thanks,

    Frank Grimes
     
  5. frankgrimes97

    frankgrimes97 New Member

    Messages:
    4
    Thanks Received:
    0
    As a simpler test I tried installing a RedHat rpm of Curl (curl-7.15.5-9.el5.x86_64.rpm) and I still get ELF binary type "3" is not known after running brandelf -t Linuxon it.

    Can someone else try this on FreeBSD 8.2 with linux_base-f10 and let me know if it works? Maybe then we can more easily track down what's missing in my configuration.

    Thanks,

    Frank Grimes
     
  6. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,549
    Thanks Received:
    2,222
    Do you have Linux compatibility fully set up, including linproc in /etc/fstab?

    Otherwise, watching what ftp/linux-f10-curl does during install might be helpful.
     
  7. vertexSymphony

    vertexSymphony New Member

    Messages:
    79
    Thanks Received:
    13
    Clean the entire Linux enviroment, reinstall Linux base, and try downloading the 32 bit version of the binary you're interested in. The linux(4) compat layer emulates a (partial) 32 bit Linux system ABI and you're installing a 64 bit package (x86_64)

    Cheers
     
    dza and frankgrimes97 thanked for this.
  8. frankgrimes97

    frankgrimes97 New Member

    Messages:
    4
    Thanks Received:
    0
    I don't know how I missed the fact that Linux compatibility is only 32-bit... I really need 64-bit so I guess I'm out of luck here.
    Thanks for taking the time to clarify!

    Frank Grimes