From ea7eb7e3eb09a7f9444e0c599fdbafaadb3e391d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 4 Mar 1998 09:53:17 +0000 Subject: Update. 1998-03-04 09:43 Ulrich Drepper * elf/link.h (struct link_map): Add new field l_reloc_result. * elf/dl-reloc.c (_dl_relocate_object): Allocate array for results of relocation for the object to be profiled. * elf/dl-object.c (_dl_new_object): Initialize l_reloc_result field to NULL. * elf/rtld.c (_dl_start): Add comment that we must not allocate an array here. * elf/dl-runtime.c (profile_fixup): If l_reloc_result array already contains a result from a previous run use this instead of computing the value again. * elf/dl-minimal.c (malloc): Remove limit for size of allocation. 1998-03-04 11:32 Andreas Schwab --- elf/dl-minimal.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'elf/dl-minimal.c') diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c index da9c33f099..daf623318d 100644 --- a/elf/dl-minimal.c +++ b/elf/dl-minimal.c @@ -1,5 +1,5 @@ /* Minimal replacements for basic facilities used in the dynamic linker. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 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 @@ -27,7 +27,7 @@ #include /* Minimal `malloc' allocator for use while loading shared libraries. - Only small blocks are allocated, and none are ever freed. */ + No block is ever freed. */ static void *alloc_ptr, *alloc_end, *alloc_last_block; @@ -61,13 +61,13 @@ malloc (size_t n) { /* Insufficient space left; allocate another page. */ caddr_t page; - assert (n <= _dl_pagesize); - page = __mmap (0, _dl_pagesize, PROT_READ|PROT_WRITE, + size_t nup = (n + _dl_pagesize - 1) & ~(_dl_pagesize - 1); + page = __mmap (0, nup, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, _dl_zerofd, 0); assert (page != MAP_FAILED); if (page != alloc_end) alloc_ptr = page; - alloc_end = page + _dl_pagesize; + alloc_end = page + nup; } alloc_last_block = (void *) alloc_ptr; -- cgit v1.2.3