From 68c4b497dd7306e0146ebd8b3bbc8289ed4c6e33 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 11 May 2004 11:14:58 +0000 Subject: make certain that getpagesize() returns correct the value for mips by extracting the value from the ELF header. --- ldso/ldso/dl-startup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ldso/ldso/dl-startup.c') diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c index 0ac5c0b48..f92febf1c 100644 --- a/ldso/ldso/dl-startup.c +++ b/ldso/ldso/dl-startup.c @@ -133,12 +133,14 @@ DL_BOOT(unsigned long args) Elf32_Dyn *dpnt; unsigned long *hash_addr; struct r_debug *debug_addr = NULL; + size_t _dl_pagesize; int indx; #if defined(__i386__) int status = 0; #endif + /* WARNING! -- we cannot make _any_ funtion calls until we have * taken care of fixing up our own relocations. Making static * inline calls is ok, but _no_ function calls. Not yet @@ -288,7 +290,8 @@ found_got: /* Call mmap to get a page of writable memory that can be used * for _dl_malloc throughout the shared lib loader. */ - mmap_zero = malloc_buffer = _dl_mmap((void *) 0, PAGE_SIZE, + _dl_pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : 4096; + mmap_zero = malloc_buffer = _dl_mmap((void *) 0, _dl_pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (_dl_mmap_check_error(mmap_zero)) { SEND_STDERR("dl_boot: mmap of a spare page failed!\n"); -- cgit v1.2.3