This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix malloc_info namespace (bug 17570)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Mon, 10 Nov 2014 16:34:40 +0000
- Subject: Fix malloc_info namespace (bug 17570)
- Authentication-results: sourceware.org; auth=none
malloc_info is defined in the same file as malloc and free, but is not
an ISO C function, so should be a weak symbol. This patch makes it
so, fixing one of the bugs shown in the sample output of my proposed
tests for such namespace issues
<https://sourceware.org/ml/libc-alpha/2014-11/msg00157.html>.
Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).
2014-11-10 Joseph Myers <joseph@codesourcery.com>
[BZ #17570]
* malloc/malloc.c (malloc_info): Rename to __malloc_info and
define as weak alias of __malloc_info.
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 6cbe9f3..6bfb859 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -4993,7 +4993,7 @@ weak_alias (__posix_memalign, posix_memalign)
int
-malloc_info (int options, FILE *fp)
+__malloc_info (int options, FILE *fp)
{
/* For now, at least. */
if (options != 0)
@@ -5166,6 +5166,7 @@ malloc_info (int options, FILE *fp)
return 0;
}
+weak_alias (__malloc_info, malloc_info)
strong_alias (__libc_calloc, __calloc) weak_alias (__libc_calloc, calloc)
--
Joseph S. Myers
joseph@codesourcery.com