From owner-svn-src-stable-7@FreeBSD.ORG Sun Mar 1 22:48:18 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFDF01065676; Sun, 1 Mar 2009 22:48:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B23718FC1C; Sun, 1 Mar 2009 22:48:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n21MmIoA056436; Sun, 1 Mar 2009 22:48:18 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n21MmIgg056435; Sun, 1 Mar 2009 22:48:18 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903012248.n21MmIgg056435@svn.freebsd.org> From: Robert Watson Date: Sun, 1 Mar 2009 22:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189255 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2009 22:48:19 -0000 Author: rwatson Date: Sun Mar 1 22:48:18 2009 New Revision: 189255 URL: http://svn.freebsd.org/changeset/base/189255 Log: Merge r187686 from head to stable/7: When a statically linked binary is executed (or at least, one without an interpreter definition in its program header), set the auxiliary ELF argument AT_BASE to 0 rather than to the address that we would have mapped the interpreter at if there had been one. The ELF ABI specifications appear to be ambiguous as to the desired behavior in this situation, as they define AT_BASE as the base address of the interpreter, but do not mention what to do if there is none. On Solaris, AT_BASE will be set to the base address of the static binary if there is no interpreter, and on Linux, AT_BASE is set to 0. We go with the Linux semantics as they are of more immediate utility and allow the early runtime environment to know that the kernel has not mapped an interpreter, but because AT_PHDR points at the ELF header for the running binary, it is still possible to retrieve all required mapping information when the process starts should it be required. Either approach would be preferable to our current behavior of passing a pointer to an unmapped region of user memory as AT_BASE. Sponsored by: Google Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/imgact_elf.c Modified: stable/7/sys/kern/imgact_elf.c ============================================================================== --- stable/7/sys/kern/imgact_elf.c Sun Mar 1 22:40:15 2009 (r189254) +++ stable/7/sys/kern/imgact_elf.c Sun Mar 1 22:48:18 2009 (r189255) @@ -830,7 +830,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i uprintf("ELF interpreter %s not found\n", interp); return (error); } - } + } else + addr = 0; /* * Construct auxargs table (used by the fixup routine)