aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2019-09-03 19:48:23 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2019-09-03 19:48:23 +0000
commitee6da5cee7d3baa0704c57b97e59379e4b74bc9c (patch)
tree088ba8ab122419e5f4c37fd06aec89c7ab1484e0 /sys
parent191ae5bfa99f9b639657a8d7845e4b4bcf33ece8 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/linux/linux_sysvec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c
index caef96cffa19d..368b5196fba4f 100644
--- a/sys/amd64/linux/linux_sysvec.c
+++ b/sys/amd64/linux/linux_sysvec.c
@@ -343,6 +343,12 @@ linux_copyout_strings(struct image_params *imgp)
*/
vectp -= imgp->args->argc + 1 + imgp->args->envc + 1;
+ /*
+ * Starting with 2.24, glibc depends on a 16-byte stack alignment.
+ * One "long argc" will be prepended later.
+ */
+ vectp = (char **)((((uintptr_t)vectp + 8) & ~0xF) - 8);
+
/* vectp also becomes our initial stack base. */
stack_base = (register_t *)vectp;