Date: Sat, 15 Aug 2020 17:02:23 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r364258 - stable/12/sys/amd64/linux Message-ID: <202008151702.07FH2NFt026954@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Sat Aug 15 17:02:23 2020 New Revision: 364258 URL: https://svnweb.freebsd.org/changeset/base/364258 Log: MFC r351783: Unbreak Linux binaries linked against new glibc, such as the ones from recent Ubuntu versions. Without it they segfault on startup. Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/amd64/linux/linux_sysvec.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/12/sys/amd64/linux/linux_sysvec.c Sat Aug 15 16:48:58 2020 (r364257) +++ stable/12/sys/amd64/linux/linux_sysvec.c Sat Aug 15 17:02:23 2020 (r364258) @@ -357,6 +357,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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008151702.07FH2NFt026954>