Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Apr 1999 23:59:04 -0400 (EDT)
From:      Luoqi Chen <luoqi@watermarkgroup.com>
To:        andrew@lake.com.au
Cc:        freebsd-emulation@FreeBSD.ORG, nox@jelal.kn-bremen.de
Subject:   Re: Wine, Win32 stripped executables vs FreeBSD mmap()
Message-ID:  <199904290359.XAA11663@lor.watermarkgroup.com>

next in thread | raw e-mail | index | archive | help
> I'll send the patch to the Wine folk, to see if they want to try
> it, but if you have any thoughts about why mmap was ignoring my
> address "hint", I'd be keen to hear them.
> 
mmap() is ignoring hint that's below data heap and its potential growth
area. While it works fine for a.out executables because there is no useable
space below data heap, this is no longer true for elf executables. Please
try this patch,

Index: vm/vm_mmap.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_mmap.c,v
retrieving revision 1.94
diff -u -r1.94 vm_mmap.c
--- vm_mmap.c	1999/04/27 11:18:49	1.94
+++ vm_mmap.c	1999/04/29 03:47:28
@@ -228,7 +228,9 @@
 	 * There should really be a pmap call to determine a reasonable
 	 * location.
 	 */
-	else if (addr < round_page((vm_offset_t)p->p_vmspace->vm_daddr + MAXDSIZ))
+	else if (addr == 0 ||
+	    addr >= round_page((vm_offset_t)p->p_vmspace->vm_taddr) &&
+	    addr < round_page((vm_offset_t)p->p_vmspace->vm_daddr + MAXDSIZ))
 		addr = round_page((vm_offset_t)p->p_vmspace->vm_daddr + MAXDSIZ);
 
 	if (flags & MAP_ANON) {
> -- 
> Andrew
> 

-lq


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message




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