[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1452209679-19445-12-git-send-email-ynorov@caviumnetworks.com>
Date: Fri, 8 Jan 2016 02:34:29 +0300
From: Yury Norov <ynorov@...iumnetworks.com>
To: <arnd@...db.de>, <catalin.marinas@....com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <ynorov@...iumnetworks.com>, <pinskia@...il.com>,
<Prasun.Kapoor@...iumnetworks.com>, <schwab@...e.de>,
<Nathan_Lynch@...tor.com>, <agraf@...e.de>,
<klimov.linux@...il.com>, <broonie@...nel.org>,
<jan.dakinevich@...il.com>, <ddaney.cavm@...il.com>,
<bamvor.zhangjian@...wei.com>,
<philipp.tomsich@...obroma-systems.com>, <joseph@...esourcery.com>,
<christoph.muellner@...obroma-systems.com>
Subject: [PATCH v6 11/21] arm64: ilp32: introduce binfmt_ilp32.c
to handle ILP32 binaries
Signed-off-by: Yury Norov <ynorov@...iumnetworks.com>
---
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/binfmt_ilp32.c | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+)
create mode 100644 arch/arm64/kernel/binfmt_ilp32.c
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index f1b798a..ad7158c 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -28,6 +28,7 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE
arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \
sys_compat.o entry32.o \
../../arm/kernel/opcodes.o binfmt_elf32.o
+arm64-obj-$(CONFIG_ARM64_ILP32) += binfmt_ilp32.o
arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o
arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o
arm64-obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
diff --git a/arch/arm64/kernel/binfmt_ilp32.c b/arch/arm64/kernel/binfmt_ilp32.c
new file mode 100644
index 0000000..02a7a6c
--- /dev/null
+++ b/arch/arm64/kernel/binfmt_ilp32.c
@@ -0,0 +1,21 @@
+/*
+ * Support for ILP32 Linux/aarch64 ELF binaries.
+ */
+
+/* AARCH64 ILP32 EABI. */
+#define compat_elf_check_arch(x) (((x)->e_machine == EM_AARCH64) \
+ && (x)->e_ident[EI_CLASS] == ELFCLASS32)
+
+#define COMPAT_SET_PERSONALITY(ex) \
+do { \
+ set_thread_flag(TIF_32BIT_AARCH64); \
+ clear_thread_flag(TIF_32BIT); \
+} while (0)
+
+#define COMPAT_ARCH_DLINFO \
+do { \
+ NEW_AUX_ENT(AT_SYSINFO_EHDR, \
+ (elf_addr_t)(long)current->mm->context.vdso); \
+} while (0)
+
+#include "../../../fs/compat_binfmt_elf.c"
--
2.5.0
Powered by blists - more mailing lists