0001 # SPDX-License-Identifier: GPL-2.0-only
0002
0003 menu "Executable file formats"
0004
0005 config BINFMT_ELF
0006 bool "Kernel support for ELF binaries"
0007 depends on MMU
0008 select ELFCORE
0009 default y
0010 help
0011 ELF (Executable and Linkable Format) is a format for libraries and
0012 executables used across different architectures and operating
0013 systems. Saying Y here will enable your kernel to run ELF binaries
0014 and enlarge it by about 13 KB. ELF support under Linux has now all
0015 but replaced the traditional Linux a.out formats (QMAGIC and ZMAGIC)
0016 because it is portable (this does *not* mean that you will be able
0017 to run executables from different architectures or operating systems
0018 however) and makes building run-time libraries very easy. Many new
0019 executables are distributed solely in ELF format. You definitely
0020 want to say Y here.
0021
0022 Information about ELF is contained in the ELF HOWTO available from
0023 <http://www.tldp.org/docs.html#howto>.
0024
0025 If you find that after upgrading from Linux kernel 1.2 and saying Y
0026 here, you still can't run any ELF binaries (they just crash), then
0027 you'll have to install the newest ELF runtime libraries, including
0028 ld.so (check the file <file:Documentation/Changes> for location and
0029 latest version).
0030
0031 config BINFMT_ELF_KUNIT_TEST
0032 bool "Build KUnit tests for ELF binary support" if !KUNIT_ALL_TESTS
0033 depends on KUNIT=y && BINFMT_ELF=y
0034 default KUNIT_ALL_TESTS
0035 help
0036 This builds the ELF loader KUnit tests, which try to gather
0037 prior bug fixes into a regression test collection. This is really
0038 only needed for debugging. Note that with CONFIG_COMPAT=y, the
0039 compat_binfmt_elf KUnit test is also created.
0040
0041 config COMPAT_BINFMT_ELF
0042 def_bool y
0043 depends on COMPAT && BINFMT_ELF
0044 select ELFCORE
0045
0046 config ARCH_BINFMT_ELF_STATE
0047 bool
0048
0049 config ARCH_BINFMT_ELF_EXTRA_PHDRS
0050 bool
0051
0052 config ARCH_HAVE_ELF_PROT
0053 bool
0054
0055 config ARCH_USE_GNU_PROPERTY
0056 bool
0057
0058 config BINFMT_ELF_FDPIC
0059 bool "Kernel support for FDPIC ELF binaries"
0060 default y if !BINFMT_ELF
0061 depends on ARM || ((M68K || SUPERH) && !MMU)
0062 select ELFCORE
0063 help
0064 ELF FDPIC binaries are based on ELF, but allow the individual load
0065 segments of a binary to be located in memory independently of each
0066 other. This makes this format ideal for use in environments where no
0067 MMU is available as it still permits text segments to be shared,
0068 even if data segments are not.
0069
0070 It is also possible to run FDPIC ELF binaries on MMU linux also.
0071
0072 config ELFCORE
0073 bool
0074 help
0075 This option enables kernel/elfcore.o.
0076
0077 config CORE_DUMP_DEFAULT_ELF_HEADERS
0078 bool "Write ELF core dumps with partial segments"
0079 default y
0080 depends on BINFMT_ELF && ELF_CORE
0081 help
0082 ELF core dump files describe each memory mapping of the crashed
0083 process, and can contain or omit the memory contents of each one.
0084 The contents of an unmodified text mapping are omitted by default.
0085
0086 For an unmodified text mapping of an ELF object, including just
0087 the first page of the file in a core dump makes it possible to
0088 identify the build ID bits in the file, without paying the i/o
0089 cost and disk space to dump all the text. However, versions of
0090 GDB before 6.7 are confused by ELF core dump files in this format.
0091
0092 The core dump behavior can be controlled per process using
0093 the /proc/PID/coredump_filter pseudo-file; this setting is
0094 inherited. See Documentation/filesystems/proc.rst for details.
0095
0096 This config option changes the default setting of coredump_filter
0097 seen at boot time. If unsure, say Y.
0098
0099 config BINFMT_SCRIPT
0100 tristate "Kernel support for scripts starting with #!"
0101 default y
0102 help
0103 Say Y here if you want to execute interpreted scripts starting with
0104 #! followed by the path to an interpreter.
0105
0106 You can build this support as a module; however, until that module
0107 gets loaded, you cannot run scripts. Thus, if you want to load this
0108 module from an initramfs, the portion of the initramfs before loading
0109 this module must consist of compiled binaries only.
0110
0111 Most systems will not boot if you say M or N here. If unsure, say Y.
0112
0113 config ARCH_HAS_BINFMT_FLAT
0114 bool
0115
0116 config BINFMT_FLAT
0117 bool "Kernel support for flat binaries"
0118 depends on ARCH_HAS_BINFMT_FLAT
0119 help
0120 Support uClinux FLAT format binaries.
0121
0122 config BINFMT_FLAT_ARGVP_ENVP_ON_STACK
0123 bool
0124
0125 config BINFMT_FLAT_OLD_ALWAYS_RAM
0126 bool
0127
0128 config BINFMT_FLAT_NO_DATA_START_OFFSET
0129 bool
0130
0131 config BINFMT_FLAT_OLD
0132 bool "Enable support for very old legacy flat binaries"
0133 depends on BINFMT_FLAT
0134 help
0135 Support decade old uClinux FLAT format binaries. Unless you know
0136 you have some of those say N here.
0137
0138 config BINFMT_ZFLAT
0139 bool "Enable ZFLAT support"
0140 depends on BINFMT_FLAT
0141 select ZLIB_INFLATE
0142 help
0143 Support FLAT format compressed binaries
0144
0145 config HAVE_AOUT
0146 def_bool n
0147
0148 config BINFMT_AOUT
0149 tristate "Kernel support for a.out and ECOFF binaries"
0150 depends on HAVE_AOUT
0151 help
0152 A.out (Assembler.OUTput) is a set of formats for libraries and
0153 executables used in the earliest versions of UNIX. Linux used
0154 the a.out formats QMAGIC and ZMAGIC until they were replaced
0155 with the ELF format.
0156
0157 The conversion to ELF started in 1995. This option is primarily
0158 provided for historical interest and for the benefit of those
0159 who need to run binaries from that era.
0160
0161 Most people should answer N here. If you think you may have
0162 occasional use for this format, enable module support above
0163 and answer M here to compile this support as a module called
0164 binfmt_aout.
0165
0166 If any crucial components of your system (such as /sbin/init
0167 or /lib/ld.so) are still in a.out format, you will have to
0168 say Y here.
0169
0170 config OSF4_COMPAT
0171 bool "OSF/1 v4 readv/writev compatibility"
0172 depends on ALPHA && BINFMT_AOUT
0173 help
0174 Say Y if you are using OSF/1 binaries (like Netscape and Acrobat)
0175 with v4 shared libraries freely available from Compaq. If you're
0176 going to use shared libraries from Tru64 version 5.0 or later, say N.
0177
0178 config BINFMT_MISC
0179 tristate "Kernel support for MISC binaries"
0180 help
0181 If you say Y here, it will be possible to plug wrapper-driven binary
0182 formats into the kernel. You will like this especially when you use
0183 programs that need an interpreter to run like Java, Python, .NET or
0184 Emacs-Lisp. It's also useful if you often run DOS executables under
0185 the Linux DOS emulator DOSEMU (read the DOSEMU-HOWTO, available from
0186 <http://www.tldp.org/docs.html#howto>). Once you have
0187 registered such a binary class with the kernel, you can start one of
0188 those programs simply by typing in its name at a shell prompt; Linux
0189 will automatically feed it to the correct interpreter.
0190
0191 You can do other nice things, too. Read the file
0192 <file:Documentation/admin-guide/binfmt-misc.rst> to learn how to use this
0193 feature, <file:Documentation/admin-guide/java.rst> for information about how
0194 to include Java support. and <file:Documentation/admin-guide/mono.rst> for
0195 information about how to include Mono-based .NET support.
0196
0197 To use binfmt_misc, you will need to mount it:
0198 mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
0199
0200 You may say M here for module support and later load the module when
0201 you have use for it; the module is called binfmt_misc. If you
0202 don't know what to answer at this point, say Y.
0203
0204 config COREDUMP
0205 bool "Enable core dump support" if EXPERT
0206 default y
0207 help
0208 This option enables support for performing core dumps. You almost
0209 certainly want to say Y here. Not necessary on systems that never
0210 need debugging or only ever run flawless code.
0211
0212 endmenu