From owner-svn-src-head@FreeBSD.ORG Wed Feb 27 09:34:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 21FF8463; Wed, 27 Feb 2013 09:34:10 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 135D0339; Wed, 27 Feb 2013 09:34:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R9Y9cC093716; Wed, 27 Feb 2013 09:34:09 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R9Y9j9093715; Wed, 27 Feb 2013 09:34:09 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201302270934.r1R9Y9j9093715@svn.freebsd.org> From: Tijl Coosemans Date: Wed, 27 Feb 2013 09:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247396 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2013 09:34:10 -0000 Author: tijl Date: Wed Feb 27 09:34:09 2013 New Revision: 247396 URL: http://svnweb.freebsd.org/changeset/base/247396 Log: Map libraries linked with -Ttext-segment=base_addr at base_addr. Normal libraries have base address 0 and are unaffected by this change. PR: 176216 Submitted by: Damjan Jovanovic Reviewed by: kib MFC after: 1 week Modified: head/libexec/rtld-elf/map_object.c Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Wed Feb 27 08:56:57 2013 (r247395) +++ head/libexec/rtld-elf/map_object.c Wed Feb 27 09:34:09 2013 (r247396) @@ -175,7 +175,7 @@ map_object(int fd, const char *path, con base_vaddr = trunc_page(segs[0]->p_vaddr); base_vlimit = round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz); mapsize = base_vlimit - base_vaddr; - base_addr = hdr->e_type == ET_EXEC ? (caddr_t) base_vaddr : NULL; + base_addr = (caddr_t) base_vaddr; mapbase = mmap(base_addr, mapsize, PROT_NONE, MAP_ANON | MAP_PRIVATE | MAP_NOCORE, -1, 0);