List of executable formats on Linux [closed]

家住魔仙堡 提交于 2019-12-01 09:03:17

问题


Where do I find the list of approved/supported executable formats on my Linux system? I am expecting to find a list that contains ELF, Shebang, a.out etc. I already know that I can find in /proc/sys/fs/binfmt_misc a list of user added supported formats, but I want to see the built-in formats in the system. Where can I get that?


回答1:


The kernel configuration file has a section named Executable file formats / Emulations. The file is named /boot/config-`uname -r` on some Linux distributions like Fedora for example.

Some of the available options for 3.14.12 x86 (64 bit) are:

  • CONFIG_BINFMT_ELF
  • CONFIG_BINFMT_SCRIPT

    Say Y here if you want to execute interpreted scripts starting with #! followed by the path to an interpreter.

  • CONFIG_IA32_EMULATION

    Include code to run legacy 32-bit programs under a 64-bit kernel.

    • CONFIG_IA32_AOUT:

      Support old a.out binaries in the 32bit emulation.

    • CONFIG_X86_X32:

      Include code to run binaries for the x32 native 32-bit ABI for 64-bit processors. An x32 process gets access to the full 64-bit register file and wide data path while leaving pointers at 32 bits for smaller memory footprint.

kernel-3.14.1-200.fc20.x86_64 comes with this configuration:

CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_BINFMT_SCRIPT=y
# CONFIG_HAVE_AOUT is not set
CONFIG_BINFMT_MISC=m
CONFIG_COREDUMP=y
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_AOUT is not set
# CONFIG_X86_X32 is not set


来源:https://stackoverflow.com/questions/23311306/list-of-executable-formats-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!