Skip to content

Commit d2ed5cb

Browse files
Russell KingRussell King
authored andcommitted
[ARM] fix VFP+softfloat binaries
2.6.28-rc tightened up the ELF architecture checks on ARM. For non-EABI it only allows VFP if the hardware supports it. However, the kernel fails to also inspect the soft-float flag, so it incorrectly rejects binaries using soft-VFP. The fix is simple: also check that EF_ARM_SOFT_FLOAT isn't set before rejecting VFP binaries on non-VFP hardware. Acked-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent a75952b commit d2ed5cb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎arch/arm/kernel/elf.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ int elf_check_arch(const struct elf32_hdr *x)
2121

2222
eflags = x->e_flags;
2323
if ((eflags & EF_ARM_EABI_MASK) == EF_ARM_EABI_UNKNOWN) {
24+
unsigned int flt_fmt;
25+
2426
/* APCS26 is only allowed if the CPU supports it */
2527
if ((eflags & EF_ARM_APCS_26) && !(elf_hwcap & HWCAP_26BIT))
2628
return 0;
2729

30+
flt_fmt = eflags & (EF_ARM_VFP_FLOAT | EF_ARM_SOFT_FLOAT);
31+
2832
/* VFP requires the supporting code */
29-
if ((eflags & EF_ARM_VFP_FLOAT) && !(elf_hwcap & HWCAP_VFP))
33+
if (flt_fmt == EF_ARM_VFP_FLOAT && !(elf_hwcap & HWCAP_VFP))
3034
return 0;
3135
}
3236
return 1;

0 commit comments

Comments
 (0)