summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorrin <rin@NetBSD.org>2019-03-16 11:50:48 +0000
committerrin <rin@NetBSD.org>2019-03-16 11:50:48 +0000
commit63e22f9f2ef8fd48db34f691565f0573fd57da4e (patch)
tree7b38cc5821beb98ea0f738d1174d542bf4993723 /sys
parent9f5fe1d9b4a4cf1cc0dd32c25a49e6a2724db7ea (diff)
Bump STACK_ALIGNBYTES to (16 - 1) to satisfy requirement by AMD64
System V ABI in kernel level. This is because (1) for LLDB, we want to bypass libc/csu (and therefore manual stack alignment in _start), and (2) rtld in glibc >= 2.23 for Linux/x86_64 requires it. Fix SEGV for Linux/x86_64 binaries with glibc >= 2.23, reported as PR port-amd64/54052.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/include/param.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arch/amd64/include/param.h b/sys/arch/amd64/include/param.h
index a5e159994a0..31b295e7f65 100644
--- a/sys/arch/amd64/include/param.h
+++ b/sys/arch/amd64/include/param.h
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.29 2019/02/11 14:59:32 cherry Exp $ */
+/* $NetBSD: param.h,v 1.30 2019/03/16 11:50:48 rin Exp $ */
#ifdef __x86_64__
@@ -23,6 +23,13 @@
#define ALIGNED_POINTER(p,t) 1
+/*
+ * Align stack as required by AMD64 System V ABI. This is because
+ * (1) we want to bypass libc/csu in LLDB, and
+ * (2) rtld in glibc >= 2.23 for Linux/x86_64 requires it.
+ */
+#define STACK_ALIGNBYTES (16 - 1)
+
#define ALIGNBYTES32 (sizeof(int) - 1)
#define ALIGN32(p) (((u_long)(p) + ALIGNBYTES32) &~ALIGNBYTES32)