aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/mach/hurd/brk.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f51ccad..b6edc18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
1999-07-11 Roland McGrath <roland@baalperazim.frob.com>
+ * sysdeps/mach/hurd/brk.c (static_data_start): New variable.
+ (_hurd_set_brk, init_brk): Use that instead of &__data_start.
+ Initialize it from &__data_start if defined, or else &_end.
+
+1999-07-11 Roland McGrath <roland@baalperazim.frob.com>
+
* sysdeps/mach/hurd/mmap.c (__mmap): Short-circuit to vm_allocate
for MAP_ANON, prot==PROT_READ|PROT_WRITE.
diff --git a/sysdeps/mach/hurd/brk.c b/sysdeps/mach/hurd/brk.c
index c6eabb2..3a5ed54 100644
--- a/sysdeps/mach/hurd/brk.c
+++ b/sysdeps/mach/hurd/brk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,94,95,96,97,99 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -41,6 +41,8 @@ weak_alias (_hurd_brk, ___brk_addr)
struct mutex _hurd_brk_lock;
extern int __data_start, _end;
+weak_extern (__data_start)
+static vm_address_t static_data_start;
/* Set the end of the process's data space to INADDR.
@@ -81,7 +83,7 @@ _hurd_set_brk (vm_address_t addr)
rlimit = _hurd_rlimits[RLIMIT_DATA].rlim_cur;
__mutex_unlock (&_hurd_rlimit_lock);
- if (addr - (vm_address_t) &__data_start > rlimit)
+ if (addr - static_data_start > rlimit)
{
/* Need to increase the resource limit. */
errno = ENOMEM;
@@ -114,6 +116,8 @@ init_brk (void)
__mutex_init (&_hurd_brk_lock);
+ static_data_start = (vm_address_t) (&__data_start ?: &_end);
+
/* If _hurd_brk is already set, don't change it. The assumption is that
it was set in a previous run before something like Emacs's unexec was
called and dumped all the data up to the break at that point. */
@@ -122,7 +126,7 @@ init_brk (void)
pagend = round_page (_hurd_brk);
- _hurd_data_end = round_page ((vm_address_t) &__data_start + DATA_SIZE);
+ _hurd_data_end = round_page (static_data_start + DATA_SIZE);
if (pagend < _hurd_data_end)
{