Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/linux32/common - LINUX_GO_RT0_SIGNATURE for compa...
details: https://anonhg.NetBSD.org/src/rev/aefcf1aafeca
branches: trunk
changeset: 1026479:aefcf1aafeca
user: ryo <ryo%NetBSD.org@localhost>
date: Fri Nov 26 08:56:28 2021 +0000
description:
- LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.
it is now defined in each arch same as the other *_SIGNATURE definitions.
- add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
diffstat:
sys/compat/linux/arch/aarch64/linux_exec.h | 4 +++-
sys/compat/linux/arch/amd64/linux_exec.h | 3 ++-
sys/compat/linux/arch/arm/linux_exec.h | 4 +++-
sys/compat/linux/arch/i386/linux_exec.h | 3 ++-
sys/compat/linux/arch/mips/linux_exec.h | 3 ++-
sys/compat/linux/arch/powerpc/linux_exec.h | 3 ++-
sys/compat/linux/common/linux_exec.h | 10 +++++++++-
sys/compat/linux/common/linux_exec_elf32.c | 8 +++-----
sys/compat/linux32/arch/aarch64/linux32_exec.h | 4 +++-
sys/compat/linux32/arch/amd64/linux32_exec.h | 3 ++-
sys/compat/linux32/common/linux32_exec.h | 6 +++++-
sys/compat/linux32/common/linux32_exec_elf32.c | 7 +++++--
12 files changed, 41 insertions(+), 17 deletions(-)
diffs (250 lines):
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux/arch/aarch64/linux_exec.h
--- a/sys/compat/linux/arch/aarch64/linux_exec.h Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux/arch/aarch64/linux_exec.h Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.h,v 1.1 2021/09/23 06:56:27 ryo Exp $ */
+/* $NetBSD: linux_exec.h,v 1.2 2021/11/26 08:56:28 ryo Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -34,4 +34,6 @@
#define linux_exec_setup_stack exec_setup_stack
+#define LINUX_GO_RT0_SIGNATURE
+
#endif /* !_AARCH64_LINUX_EXEC_H */
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux/arch/amd64/linux_exec.h
--- a/sys/compat/linux/arch/amd64/linux_exec.h Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux/arch/amd64/linux_exec.h Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.h,v 1.5 2013/11/18 01:32:22 chs Exp $ */
+/* $NetBSD: linux_exec.h,v 1.6 2021/11/26 08:56:28 ryo Exp $ */
/*-
* Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -65,6 +65,7 @@
#define LINUX_MACHDEP_ELF_COPYARGS
#define LINUX_DEBUGLINK_SIGNATURE
+#define LINUX_GO_RT0_SIGNATURE
int linux_exec_setup_stack(struct lwp *, struct exec_package *);
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux/arch/arm/linux_exec.h
--- a/sys/compat/linux/arch/arm/linux_exec.h Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux/arch/arm/linux_exec.h Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.h,v 1.10 2017/02/12 21:02:19 chs Exp $ */
+/* $NetBSD: linux_exec.h,v 1.11 2021/11/26 08:56:28 ryo Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,6 +38,8 @@
#define LINUX_ELF_AUX_ARGSIZ \
(LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info) + LINUX_RANDOM_BYTES)
+#define LINUX_GO_RT0_SIGNATURE
+
#define linux_exec_setup_stack exec_setup_stack
#endif /* !_I386_LINUX_EXEC_H */
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux/arch/i386/linux_exec.h
--- a/sys/compat/linux/arch/i386/linux_exec.h Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux/arch/i386/linux_exec.h Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.h,v 1.13 2017/02/12 21:02:19 chs Exp $ */
+/* $NetBSD: linux_exec.h,v 1.14 2021/11/26 08:56:28 ryo Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -40,6 +40,7 @@
(LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info) + LINUX_RANDOM_BYTES)
#define LINUX_DEBUGLINK_SIGNATURE
+#define LINUX_GO_RT0_SIGNATURE
#ifdef _KERNEL
int linux_exec_setup_stack(struct lwp *, struct exec_package *);
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux/arch/mips/linux_exec.h
--- a/sys/compat/linux/arch/mips/linux_exec.h Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux/arch/mips/linux_exec.h Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.h,v 1.16 2017/02/12 21:02:19 chs Exp $ */
+/* $NetBSD: linux_exec.h,v 1.17 2021/11/26 08:56:28 ryo Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -57,6 +57,7 @@
#define LINUX_ATEXIT_SIGNATURE 1
#define LINUX_GCC_SIGNATURE 1
+#define LINUX_GO_RT0_SIGNATURE 1
#define LINUX_ELF_AUX_ARGSIZ \
(LINUX_ELF_AUX_ENTRIES * sizeof(Aux32Info) + LINUX_RANDOM_BYTES)
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux/arch/powerpc/linux_exec.h
--- a/sys/compat/linux/arch/powerpc/linux_exec.h Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_exec.h Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.h,v 1.24 2017/02/12 21:02:19 chs Exp $ */
+/* $NetBSD: linux_exec.h,v 1.25 2021/11/26 08:56:28 ryo Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -57,6 +57,7 @@
*/
#define LINUX_GCC_SIGNATURE 1
+#define LINUX_GO_RT0_SIGNATURE 1
/*
* LINUX_ATEXIT_SIGNATURE enable the atexit_signature test. See
* sys/compat/linux/common/linux_exec_elf32.c:linux_atexit_signature()
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux/common/linux_exec.h
--- a/sys/compat/linux/common/linux_exec.h Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux/common/linux_exec.h Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.h,v 1.54 2021/09/23 06:56:27 ryo Exp $ */
+/* $NetBSD: linux_exec.h,v 1.55 2021/11/26 08:56:28 ryo Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -155,6 +155,10 @@
int linux_elf32_atexit_signature(struct lwp *l,
struct exec_package *, Elf32_Ehdr *);
#endif
+#ifdef LINUX_GO_RT0_SIGNATURE
+int linux_elf32_go_rt0_signature(struct lwp *l,
+ struct exec_package *, Elf32_Ehdr *);
+#endif
#endif
#ifdef EXEC_ELF64
int linux_elf64_probe(struct lwp *, struct exec_package *, void *,
@@ -175,6 +179,10 @@
int linux_elf64_atexit_signature(struct lwp *l,
struct exec_package *, Elf64_Ehdr *);
#endif
+#ifdef LINUX_GO_RT0_SIGNATURE
+int linux_elf64_go_rt0_signature(struct lwp *l,
+ struct exec_package *, Elf64_Ehdr *);
+#endif
#endif
__END_DECLS
#endif /* !_KERNEL */
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux/common/linux_exec_elf32.c
--- a/sys/compat/linux/common/linux_exec_elf32.c Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux/common/linux_exec_elf32.c Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec_elf32.c,v 1.100 2020/01/12 18:30:58 ad Exp $ */
+/* $NetBSD: linux_exec_elf32.c,v 1.101 2021/11/26 08:56:28 ryo Exp $ */
/*-
* Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.100 2020/01/12 18:30:58 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.101 2021/11/26 08:56:28 ryo Exp $");
#ifndef ELFSIZE
/* XXX should die */
@@ -74,8 +74,6 @@
#include <compat/linux/linux_syscallargs.h>
#include <compat/linux/linux_syscall.h>
-#define LINUX_GO_RT0_SIGNATURE
-
#ifdef DEBUG_LINUX
#define DPRINTF(a) uprintf a
#else
@@ -275,7 +273,7 @@
* Look for a .gopclntab, specific to go binaries
* in it look for a symbol called _rt0_<cpu>_linux
*/
-static int
+int
ELFNAME2(linux,go_rt0_signature)(struct lwp *l, struct exec_package *epp, Elf_Ehdr *eh)
{
Elf_Shdr *sh;
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux32/arch/aarch64/linux32_exec.h
--- a/sys/compat/linux32/arch/aarch64/linux32_exec.h Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux32/arch/aarch64/linux32_exec.h Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_exec.h,v 1.1 2021/11/25 03:08:04 ryo Exp $ */
+/* $NetBSD: linux32_exec.h,v 1.2 2021/11/26 08:56:28 ryo Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -54,4 +54,6 @@
int linux32_exec_setup_stack(struct lwp *, struct exec_package *);
+#define LINUX32_GO_RT0_SIGNATURE
+
#endif /* _AARCH64_LINUX32_EXEC_H_ */
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux32/arch/amd64/linux32_exec.h
--- a/sys/compat/linux32/arch/amd64/linux32_exec.h Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux32/arch/amd64/linux32_exec.h Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_exec.h,v 1.9 2021/11/25 02:48:00 ryo Exp $ */
+/* $NetBSD: linux32_exec.h,v 1.10 2021/11/26 08:56:28 ryo Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -40,6 +40,7 @@
#define LINUX32_USRSTACK 0xC0000000
#define LINUX32_DEBUGLINK_SIGNATURE 1
+#define LINUX32_GO_RT0_SIGNATURE 1
/* Counted from common/linux32_exec_elf32.c */
#define LINUX32_ELF_AUX_ENTRIES 20
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux32/common/linux32_exec.h
--- a/sys/compat/linux32/common/linux32_exec.h Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux32/common/linux32_exec.h Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_exec.h,v 1.8 2021/11/25 03:08:04 ryo Exp $ */
+/* $NetBSD: linux32_exec.h,v 1.9 2021/11/26 08:56:29 ryo Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -67,6 +67,10 @@
int linux_elf32_atexit_signature(struct lwp *l,
struct exec_package *, Elf32_Ehdr *);
#endif
+#ifdef LINUX32_GO_RT0_SIGNATURE
+int linux_elf32_go_rt0_signature(struct lwp *l,
+ struct exec_package *, Elf32_Ehdr *);
+#endif
#endif /* EXEC_ELF32 */
diff -r 67945dc6222f -r aefcf1aafeca sys/compat/linux32/common/linux32_exec_elf32.c
--- a/sys/compat/linux32/common/linux32_exec_elf32.c Fri Nov 26 08:06:11 2021 +0000
+++ b/sys/compat/linux32/common/linux32_exec_elf32.c Fri Nov 26 08:56:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_exec_elf32.c,v 1.22 2021/11/25 03:08:04 ryo Exp $ */
+/* $NetBSD: linux32_exec_elf32.c,v 1.23 2021/11/26 08:56:29 ryo Exp $ */
/*-
* Copyright (c) 1995, 1998, 2000, 2001,2006 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_exec_elf32.c,v 1.22 2021/11/25 03:08:04 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_exec_elf32.c,v 1.23 2021/11/26 08:56:29 ryo Exp $");
#define ELFSIZE 32
@@ -83,6 +83,9 @@
#ifdef LINUX32_DEBUGLINK_SIGNATURE
((error = ELFNAME2(linux,debuglink_signature)(l, epp, eh)) != 0) &&
#endif
+#ifdef LINUX32_GO_RT0_SIGNATURE
+ ((error = ELFNAME2(linux,go_rt0_signature)(l, epp, eh)) != 0) &&
+#endif
1)
return error;
Home |
Main Index |
Thread Index |
Old Index