summaryrefslogtreecommitdiff
path: root/ldso/ldso/dl-elf.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-07-30 03:32:41 +0000
committerEric Andersen <andersen@codepoet.org>2004-07-30 03:32:41 +0000
commita707192f6c249d397594b2d6a0b2f38f3cdf4da7 (patch)
treea835c0f9b5cfdb45b85a2d545865c85c1861e7a1 /ldso/ldso/dl-elf.c
parent51987d4c7d42027a86c8fbedda559dde76a18a21 (diff)
Teach libdl to use normal libc symbols whenever possible, i.e. malloc
rather than _dl_malloc, fprintf rather than _dl_printf, etc. -Erik
Diffstat (limited to 'ldso/ldso/dl-elf.c')
-rw-r--r--ldso/ldso/dl-elf.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index d27e4ccb3..2dd6fc4d0 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -888,40 +888,3 @@ char *_dl_strdup(const char *string)
return retval;
}
-void *(*_dl_malloc_function) (size_t size) = NULL;
-void *_dl_malloc(int size)
-{
- void *retval;
-
-#if 0
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
- _dl_dprintf(2, "malloc: request for %d bytes\n", size);
-#endif
-#endif
-
- if (_dl_malloc_function)
- return (*_dl_malloc_function) (size);
-
- if (_dl_malloc_addr - _dl_mmap_zero + size > _dl_pagesize) {
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
- _dl_dprintf(2, "malloc: mmapping more memory\n");
-#endif
- _dl_mmap_zero = _dl_malloc_addr = _dl_mmap((void *) 0, size,
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- if (_dl_mmap_check_error(_dl_mmap_zero)) {
- _dl_dprintf(2, "%s: mmap of a spare page failed!\n", _dl_progname);
- _dl_exit(20);
- }
- }
- retval = _dl_malloc_addr;
- _dl_malloc_addr += size;
-
- /*
- * Align memory to 4 byte boundary. Some platforms require this, others
- * simply get better performance.
- */
- _dl_malloc_addr = (unsigned char *) (((unsigned long) _dl_malloc_addr + 3) & ~(3));
- return retval;
-}
-
-