As arm64 is about to introduce MTE-specific phdrs in the core dump, add
a common CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS option currently selectable
by UML_X86 and IA64.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Link: https://lore.kernel.org/r/20220131165456.2160675-2-catalin.marinas@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
 
 config IA64
        bool
+       select ARCH_BINFMT_ELF_EXTRA_PHDRS
        select ARCH_HAS_DMA_MARK_CLEAN
        select ARCH_HAS_STRNCPY_FROM_USER
        select ARCH_HAS_STRNLEN_USER
 
 
 config UML_X86
        def_bool y
+       select ARCH_BINFMT_ELF_EXTRA_PHDRS if X86_32
 
 config 64BIT
        bool "64-bit kernel" if "$(SUBARCH)" = "x86"
 
 config ARCH_BINFMT_ELF_STATE
        bool
 
+config ARCH_BINFMT_ELF_EXTRA_PHDRS
+       bool
+
 config ARCH_HAVE_ELF_PROT
        bool
 
 
 #endif
 }
 
-#if (defined(CONFIG_UML) && defined(CONFIG_X86_32)) || defined(CONFIG_IA64)
+#ifdef CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS
 /*
  * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
  * extra segments containing the gate DSO contents.  Dumping its
 {
        return 0;
 }
-#endif
+#endif /* CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS */
 
 #endif /* _LINUX_ELFCORE_H */