2009年11月1日 星期日

Linux Command - file

# file programA
"programA": ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

# file programB
"programB": ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

32 bits program can be run on the 64 bits platform.
But 64 bits program can not run on the 32 bits platform

Add -m 32 in the CFLAG to compile a 32 bits program in the 64 bits platform for backward compatbility.

# The following target was ARM-chipset device
$ file core
core: ELF 32-bit MSB core file, ARM, version 1 (SYSV), SVR4-style, from 'programARM'
$ file programARM
programARM: ELF 32-bit MSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped


# The following target was X86 PC
# file programX86
programX86: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

沒有留言: