Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1449172
| From | Nicolas Pitre <nicolas.pitre@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v5 13/15] m68k: fix bFLT executable running on MMU enabled systems |
| Date | 2016-07-24 17:40 +0200 |
| Message-ID | <rYtFx-19R-39@gated-at.bofh.it> (permalink) |
| References | <rYtFw-19R-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Greg Ungerer <gerg@linux-m68k.org>
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 <gerg@linux-m68k.org>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
---
arch/m68k/include/asm/flat.h | 6 ++++++
arch/m68k/include/asm/processor.h | 2 --
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/m68k/include/asm/flat.h b/arch/m68k/include/asm/flat.h
index f9454b89a5..f46c2f044f 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__ */
diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h
index a6ce2ec8d6..46672d1f4d 100644
--- a/arch/m68k/include/asm/processor.h
+++ b/arch/m68k/include/asm/processor.h
@@ -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)
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v5 00/15] allow BFLT executables on systems with a MMU Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-24 17:40 +0200 [PATCH v5 09/15] binfmt_flat: use clear_user() rather than memset() to clear .bss Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-24 17:40 +0200 [PATCH v5 02/15] binfmt_flat: convert printk invocations to their modern form Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-24 17:40 +0200 [PATCH v5 04/15] elf_fdpic_transfer_args_to_stack(): make it generic Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-24 17:40 +0200 [PATCH v5 13/15] m68k: fix bFLT executable running on MMU enabled systems Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-24 17:40 +0200
csiph-web