1

I have a renesas v3h ARM v8 processor on an embedded platform. The yocto Linux on it doesnt have support for sshd so I was trying to install the binary in the rootfs. I downloaded the binary from here and copied it in the rootfs. When I try to run it, I get this error

root@v3h:/usr/bin# sshd
-sh: /usr/bin/sshd: cannot execute binary file: Exec format error

To be sure that the binary is infact for an arm64, I did this -

readelf -h sshd

and the output is this -

ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           AArch64

Here are the permissions for ssh and sshd. ssh btw works fine.

lrwxrwxrwx    1 1000     1000            23 Jan 28 11:27 ssh -> /usr/sbin/dropbearmulti
-rwxrwxr-x    1 1000     1000       2734032 Apr  2  2019 sshd

How do I resolve this?

Edit:

kernel information-

root@v3h:/usr/bin# uname -a
Linux v3h-p708 4.9.0-yocto-standard #7 SMP PREEMPT Mon Jan 28 13:14:31 MSK 2019 aarch64 GNU/Linux
  • What is the readelf output for some other binary that does work on your system? – Kusalananda Apr 03 '19 at 16:25
  • What's the output of file /usr/bin/sshd and ldd /usr/bin/sshd? I suspect something's wrong with the loader (see https://unix.stackexchange.com/questions/11000/no-such-file-or-directory-lies-on-optware-installed-binaries/11008#11008 for explanations), although I don't know why this would result in ENOEXEC rather than ENOENT. Taking a binary from another distribution doesn't always work, if they use different libc or configure it differently. Try sshd from Yocto or OpenEmbedded. – Gilles 'SO- stop being evil' Apr 03 '19 at 16:46
  • Everythig is the same except the type:

    readelf -h candump Type: EXEC (Executable file)

    – o4385630 Apr 03 '19 at 16:54
  • file: command not found

    ldd /usr/bin/sshd not a dynamic executable

    – o4385630 Apr 03 '19 at 16:55
  • And, even with your processor being an v3h Arm v8, what is the version of the Kernel you are using? Could you please provide the results of uname -a at the question? You will not be able to run a v8 binary if you are using a generic 32bits Arm Kernel... –  Apr 03 '19 at 17:06
  • @nwildner I just added the uname-a information. – o4385630 Apr 03 '19 at 18:14
  • @ Kusalananda, do you think the Type value difference in the two is the culprit? A search for the same doesnt seem to indicate that. – o4385630 Apr 03 '19 at 21:31

0 Answers0