summaryrefslogtreecommitdiff
path: root/ldso/ldso/dl-startup.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-05-11 11:14:58 +0000
committerEric Andersen <andersen@codepoet.org>2004-05-11 11:14:58 +0000
commit68c4b497dd7306e0146ebd8b3bbc8289ed4c6e33 (patch)
treeb76126f13f820979dac7a8084bd5a82f39c82995 /ldso/ldso/dl-startup.c
parentfd4f96fda50d2462621de89762659e7cc7d648a9 (diff)
make certain that getpagesize() returns correct the value for mips
by extracting the value from the ELF header.
Diffstat (limited to 'ldso/ldso/dl-startup.c')
-rw-r--r--ldso/ldso/dl-startup.c5
1 files changed, 4 insertions, 1 deletions
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");