aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-minimal.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r--elf/dl-minimal.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index d83620d02b..12d38c9a3a 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 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997 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
@@ -77,6 +77,17 @@ malloc (size_t n)
return alloc_last_block;
}
+/* We use this function occasionally since the real implementation may
+ be optimized when it can assume the memory it returns already is
+ set to NUL. */
+void * weak_function
+calloc (size_t nmemb, size_t size)
+{
+ size_t total = nmemb * size;
+ void *result = malloc (total);
+ return memset (result, '\0', total);
+}
+
/* This will rarely be called. */
void weak_function
free (void *ptr)