Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Oct 2011 09:55:16 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r225961 - stable/8/libexec/rtld-elf
Message-ID:  <201110040955.p949tGO2052020@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Oct  4 09:55:15 2011
New Revision: 225961
URL: http://svn.freebsd.org/changeset/base/225961

Log:
  MFC r225699:
  Restore the writing of the .bss sections of the dsos.
  Revert the optimization of using mprotect(2) to establish .bss, overlap
  the section with mmap(2).

Modified:
  stable/8/libexec/rtld-elf/map_object.c
Directory Properties:
  stable/8/libexec/rtld-elf/   (props changed)

Modified: stable/8/libexec/rtld-elf/map_object.c
==============================================================================
--- stable/8/libexec/rtld-elf/map_object.c	Tue Oct  4 06:46:12 2011	(r225960)
+++ stable/8/libexec/rtld-elf/map_object.c	Tue Oct  4 09:55:15 2011	(r225961)
@@ -209,8 +209,9 @@ map_object(int fd, const char *path, con
 	    bss_vlimit = round_page(segs[i]->p_vaddr + segs[i]->p_memsz);
 	    bss_addr = mapbase +  (bss_vaddr - base_vaddr);
 	    if (bss_vlimit > bss_vaddr) {	/* There is something to do */
-		if (mprotect(bss_addr, bss_vlimit - bss_vaddr, data_prot) == -1) {
-		    _rtld_error("%s: mprotect of bss failed: %s", path,
+		if (mmap(bss_addr, bss_vlimit - bss_vaddr, data_prot,
+		    data_flags | MAP_ANON, -1, 0) == (caddr_t)-1) {
+		    _rtld_error("%s: mmap of bss failed: %s", path,
 			strerror(errno));
 		    return NULL;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110040955.p949tGO2052020>