深入理解linux执行文件提示No such file or directory的背后原因

  root@tegra-ubuntu:~# readelf -h a.out

  ELF Header:

  Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

  Class: ELF32

  Data: 2's complement, little endian

  Version: 1 (current)

  OS/ABI: UNIX - System V

  ABI Version: 0

  Type: EXEC (Executable file)

  Machine: ARM

  Version: 0x1

  Entry point address: 0x8315

  Start of program headers: 52 (bytes into file)

  Start of section headers: 4500 (bytes into file)

  Flags: 0x5000402, has entry point, Version5 EABI, hard-float ABI

  Size of this header: 52 (bytes)

  Size of program headers: 32 (bytes)

  Number of program headers: 9

  Size of section headers: 40 (bytes)

  Number of section headers: 30

  Section header string table index: 27

  root@tegra-ubuntu:~# readelf -h b.out

  ELF Header:

  Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

  Class: ELF32

  Data: 2's complement, little endian

  Version: 1 (current)

  OS/ABI: UNIX - System V

  ABI Version: 0

  Type: EXEC (Executable file)

  Machine: ARM

  Version: 0x1

  Entry point address: 0x86bc

  Start of program headers: 52 (bytes into file)

  Start of section headers: 4136 (bytes into file)

  Flags: 0x5000202, has entry point, Version5 EABI, soft-float ABI

  Size of this header: 52 (bytes)

  Size of program headers: 32 (bytes)

  Number of program headers: 8

  Size of section headers: 40 (bytes)

  Number of section headers: 31

  Section header string table index: 28

  root@tegra-ubuntu:~# readelf -l helloworld | grep interpreter

  readelf: Error: 'helloworld': No such file

  root@tegra-ubuntu:~# readelf -l a.out | grep interpreter

  [Requesting program interpreter: /lib/ld-linux-armhf.so.3]

  root@tegra-ubuntu:~# readelf -l b.out | grep interpreter

  [Requesting program interpreter: /lib/ld-linux.so.3]