From 89e6ffd9f03936d9f6f0332426e4a3cf379b90bd Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Thu, 21 Jul 2016 16:28:48 +1000 Subject: m68k: fix bFLT executable running on MMU enabled systems Even after recent changes to support running flat format executables on MMU enabled systems (by nicolas.pitre@linaro.org) they still failed to run on m68k/ColdFire MMU enabled systems. On trying to run a flat format binary the application would immediately crash with a SIGSEGV. Code to setup the D5 register with the base of the application data region was only in the non-MMU code path, so it was not being set for the MMU enabled case. Flat binaries on m68k/ColdFire use this to support GOT/PIC flat built application code. Fix this so that D5 is always setup when loading/running a bFLT executable on m68k systems. Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/flat.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/m68k/include/asm/flat.h') diff --git a/arch/m68k/include/asm/flat.h b/arch/m68k/include/asm/flat.h index f9454b89a51b..f46c2f044f8c 100644 --- a/arch/m68k/include/asm/flat.h +++ b/arch/m68k/include/asm/flat.h @@ -18,4 +18,10 @@ static inline int flat_set_persistent(unsigned long relval, return 0; } +#define FLAT_PLAT_INIT(regs) \ + do { \ + if (current->mm) \ + (regs)->d5 = current->mm->start_data; \ + } while (0) + #endif /* __M68KNOMMU_FLAT_H__ */ -- cgit v1.2.3