ANDROID: 16K: Remove build time dependencies on ELF_EXEC_PAGESIZE

Since page-compat mode needs to be runtime switchable, non-const
globals need to be initialized from a function.  Intialize
elf_format.min_coredump from init_elf_binfmt()

Remove preprocessor checks on ELF_EXEC_PAGESIZE. ELF_EXEC_PAGESIZE is
always the same as PAGE_SIZE on Android supported architectures.

This is a preparatory change for subsequent patches in the series.

Bug: 383389337
Bug: 315325080
Bug: 302403436
Change-Id: I7d748ae1897384720272284493befff2aa4d2325
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
This commit is contained in:
Kalesh Singh
2024-02-08 21:56:31 -08:00
committed by Carlos Llamas
parent d09cd43b3f
commit 58e2fa4ec4

View File

@@ -84,11 +84,7 @@ static int elf_core_dump(struct coredump_params *cprm);
#define elf_core_dump NULL
#endif
#if ELF_EXEC_PAGESIZE > PAGE_SIZE
#define ELF_MIN_ALIGN ELF_EXEC_PAGESIZE
#else
#define ELF_MIN_ALIGN PAGE_SIZE
#endif
#ifndef ELF_CORE_EFLAGS
#define ELF_CORE_EFLAGS 0
@@ -104,7 +100,8 @@ static struct linux_binfmt elf_format = {
.load_shlib = load_elf_library,
#ifdef CONFIG_COREDUMP
.core_dump = elf_core_dump,
.min_coredump = ELF_EXEC_PAGESIZE,
/* init_elf_binfmt() overrides .min_coredump with the correct emulated page-size. */
.min_coredump = PAGE_SIZE,
#endif
};
@@ -2143,6 +2140,7 @@ end_coredump:
static int __init init_elf_binfmt(void)
{
elf_format.min_coredump = ELF_EXEC_PAGESIZE;
register_binfmt(&elf_format);
return 0;
}