2022-04-28 11:17:01

by Greg Ungerer

[permalink] [raw]
Subject: [PATCH 0/4] m68knommu: add support for elf-fdpic

Add support to the m68k architecture code for the elf-fdpic loader.
As of commit 1bde925d2354 ("fs/binfmt_elf_fdpic.c: provide NOMMU loader
for regular ELF binaries") it is possible to run normal ELF executables
on nommu systems. These are simple enough to generate and test - even
without actual elf-fdpic toolchain support.

A few minor changes are required to have everything in place, all on the
architecture code side. The largest required addition is minimal regset
support (for elf-fdpic core dumping), otherwise a couple of cleanups and
some definitions is all that is required.

Note that this is only supporting nommu mode on the m68k at this time.
Changes will be required to the mm_context_t type to support elf-fdpic
with MMU enabled on m68k.

Signed-off-by: Greg Ungerer <[email protected]>
---
arch/m68k/include/asm/elf.h | 9 +++++
arch/m68k/include/asm/mmu.h | 4 --
arch/m68k/include/uapi/asm/ptrace.h | 5 +++
arch/m68k/kernel/ptrace.c | 58 ++++++++++++++++++++++++++++++++++++
fs/Kconfig.binfmt | 2 -
5 files changed, 74 insertions(+), 4 deletions(-)



2022-04-28 13:06:12

by Greg Ungerer

[permalink] [raw]
Subject: [PATCH 4/4] m68knommu: allow elf_fdpic loader to be selected

The m68k architecture code is capable of supporting the binfmt_elf_fdpic
loader, so allow it to be configured. It is restricted to nommu
configurations at this time due to the MMU context structures/code not
supporting everything elf_fdpic needs when MMU is enabled.

Signed-off-by: Greg Ungerer <[email protected]>
---
fs/Kconfig.binfmt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
index 21c6332fa785..2666398120c4 100644
--- a/fs/Kconfig.binfmt
+++ b/fs/Kconfig.binfmt
@@ -58,7 +58,7 @@ config ARCH_USE_GNU_PROPERTY
config BINFMT_ELF_FDPIC
bool "Kernel support for FDPIC ELF binaries"
default y if !BINFMT_ELF
- depends on (ARM || (SUPERH && !MMU))
+ depends on (ARM || ((M68K || SUPERH) && !MMU))
select ELFCORE
help
ELF FDPIC binaries are based on ELF, but allow the individual load
--
2.25.1