Commit b62a8486 authored by Catalin Marinas's avatar Catalin Marinas Committed by Will Deacon

elfcore: Replace CONFIG_{IA64, UML} checks with a new option

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: default avatarCatalin Marinas <catalin.marinas@arm.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Link: https://lore.kernel.org/r/20220131165456.2160675-2-catalin.marinas@arm.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent dfd42fac
...@@ -8,6 +8,7 @@ menu "Processor type and features" ...@@ -8,6 +8,7 @@ menu "Processor type and features"
config IA64 config IA64
bool bool
select ARCH_BINFMT_ELF_EXTRA_PHDRS
select ARCH_HAS_DMA_MARK_CLEAN select ARCH_HAS_DMA_MARK_CLEAN
select ARCH_HAS_STRNCPY_FROM_USER select ARCH_HAS_STRNCPY_FROM_USER
select ARCH_HAS_STRNLEN_USER select ARCH_HAS_STRNLEN_USER
......
...@@ -8,6 +8,7 @@ endmenu ...@@ -8,6 +8,7 @@ endmenu
config UML_X86 config UML_X86
def_bool y def_bool y
select ARCH_BINFMT_ELF_EXTRA_PHDRS if X86_32
config 64BIT config 64BIT
bool "64-bit kernel" if "$(SUBARCH)" = "x86" bool "64-bit kernel" if "$(SUBARCH)" = "x86"
......
...@@ -36,6 +36,9 @@ config COMPAT_BINFMT_ELF ...@@ -36,6 +36,9 @@ config COMPAT_BINFMT_ELF
config ARCH_BINFMT_ELF_STATE config ARCH_BINFMT_ELF_STATE
bool bool
config ARCH_BINFMT_ELF_EXTRA_PHDRS
bool
config ARCH_HAVE_ELF_PROT config ARCH_HAVE_ELF_PROT
bool bool
......
...@@ -114,7 +114,7 @@ static inline int elf_core_copy_task_fpregs(struct task_struct *t, struct pt_reg ...@@ -114,7 +114,7 @@ static inline int elf_core_copy_task_fpregs(struct task_struct *t, struct pt_reg
#endif #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 * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
* extra segments containing the gate DSO contents. Dumping its * extra segments containing the gate DSO contents. Dumping its
...@@ -149,6 +149,6 @@ static inline size_t elf_core_extra_data_size(void) ...@@ -149,6 +149,6 @@ static inline size_t elf_core_extra_data_size(void)
{ {
return 0; return 0;
} }
#endif #endif /* CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS */
#endif /* _LINUX_ELFCORE_H */ #endif /* _LINUX_ELFCORE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment