diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-03-04 09:53:17 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-03-04 09:53:17 +0000 |
commit | ea7eb7e3eb09a7f9444e0c599fdbafaadb3e391d (patch) | |
tree | 0d80af9968048e23bd0781ee7b9759c9af27235d /elf/dl-minimal.c | |
parent | f6d8a525ef354f5903f81d20ed879935c633aafd (diff) | |
download | glibc-ea7eb7e3eb09a7f9444e0c599fdbafaadb3e391d.tar.gz glibc-ea7eb7e3eb09a7f9444e0c599fdbafaadb3e391d.tar.xz glibc-ea7eb7e3eb09a7f9444e0c599fdbafaadb3e391d.zip |
Update.
1998-03-04 09:43 Ulrich Drepper <drepper@cygnus.com> * 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 <schwab@issan.informatik.uni-dortmund.de>
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r-- | elf/dl-minimal.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 <errno.h> /* 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; |