diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-08-16 19:17:37 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-08-16 19:17:37 +0000 |
commit | aa1a5f5c1a6cf2ff1d8cf9611133c5872165c47e (patch) | |
tree | b6c8712530a80b412014c18514082ecc200cc925 /ldso | |
parent | 402649ba485878ee72bdfcece68b613a075b2673 (diff) |
The pagesize variable used when starting up is _not_ the same
as the _dl_pagesize global, so do not alias the global.
-Erik
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/ldso/dl-startup.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c index 5d1d5a67e..b8eb5aa17 100644 --- a/ldso/ldso/dl-startup.c +++ b/ldso/ldso/dl-startup.c @@ -133,7 +133,7 @@ DL_BOOT(unsigned long args) Elf32_Dyn *dpnt; unsigned long *hash_addr; struct r_debug *debug_addr = NULL; - size_t _dl_pagesize; + size_t pagesize; int indx; #if defined(__i386__) int status = 0; @@ -290,8 +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. */ - _dl_pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE; - mmap_zero = malloc_buffer = _dl_mmap((void *) 0, _dl_pagesize, + pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE; + mmap_zero = malloc_buffer = _dl_mmap((void *) 0, 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"); @@ -382,7 +382,7 @@ found_got: * Even though the program header is marked RWE, the kernel gives * it to us rx. */ - Elf32_Addr mpa = (ppnt->p_vaddr + app_tpnt->loadaddr) & ~(_dl_pagesize - 1); + Elf32_Addr mpa = (ppnt->p_vaddr + app_tpnt->loadaddr) & ~(pagesize - 1); Elf32_Word mps = ((ppnt->p_vaddr + app_tpnt->loadaddr) - mpa) + ppnt->p_memsz; if(_dl_mprotect(mpa, mps, PROT_READ | PROT_WRITE | PROT_EXEC)) { SEND_STDERR("Couldn't mprotect .dynamic segment to rwx.\n"); |