Message ID | 51ED957B.80105@codethink.co.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/arch/arm/kernel/elf.c b/arch/arm/kernel/elf.c index d0d1e83..37c8e66 100644 --- a/arch/arm/kernel/elf.c +++ b/arch/arm/kernel/elf.c @@ -34,6 +34,17 @@ int elf_check_arch(const struct elf32_hdr *x) if (flt_fmt == EF_ARM_VFP_FLOAT && !(elf_hwcap & HWCAP_VFP)) return 0; } + + if ((eflags & EF_ARM_EABI_MASK) >= EF_ARM_EABI_VER4) { + bool is_be8 = IS_ENABLED(CONFIG_CPU_ENDIAN_BE8); + + /* do some simple endian-ness verifications */ + if (eflags & EF_ARM_BE8 && !is_be8) + return 0; + if (eflags & EF_ARM_LE8 && is_be8) + return 0; + } + -- Ben Dooks http://www.codethink.co.uk/