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.
-/* 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
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.
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;
__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. */
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)
{