Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89e6ffd9 authored by Greg Ungerer's avatar Greg Ungerer
Browse files

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: default avatarGreg Ungerer <gerg@linux-m68k.org>
parent 47ef4ad2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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__ */
+0 −2
Original line number Diff line number Diff line
@@ -131,8 +131,6 @@ extern int handle_kernel_fault(struct pt_regs *regs);
do {                                                    \
	(_regs)->pc = (_pc);                            \
	setframeformat(_regs);                          \
	if (current->mm)                                \
		(_regs)->d5 = current->mm->start_data;  \
	(_regs)->sr &= ~0x2000;                         \
	wrusp(_usp);                                    \
} while(0)