Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2013 09:34:09 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r247396 - head/libexec/rtld-elf
Message-ID:  <201302270934.r1R9Y9j9093715@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <damjan.jov@gmail.com>
  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);



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