This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Should malloc-related functions be weak?
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: Libc-alpha Mailing List <libc-alpha at sourceware dot org>
- Cc: Florian Weimer <fweimer at redhat dot com>
- Date: Fri, 29 Jul 2016 15:27:00 -0300
- Subject: Should malloc-related functions be weak?
- Authentication-results: sourceware.org; auth=none
According to the __malloc_hook man page [1]
Programmers should instead preempt calls to the relevant functions by
defining and exporting functions such as "malloc" and "free".
But malloc, free and realloc are all global functions, causing problems when
linking statically.
Shouldn't they be weak functions?
For the record, we can close the following bugs after we answer this
question:
- https://sourceware.org/bugzilla/show_bug.cgi?id=2765
- https://sourceware.org/bugzilla/show_bug.cgi?id=16939
--
Tulio Magno