__ptmalloc_init was called too early in __libc_early_init: it uses
__libc_initial which is not set yet. Fix this by moving initialization
to the end of __libc_early_init.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
void
__libc_early_init (_Bool initial)
{
- /* Initialize system malloc. */
- call_function_static_weak (__ptmalloc_init);
-
/* Initialize ctype data. */
__ctype_init ();
#if ENABLE_ELISION_SUPPORT
__lll_elision_init ();
#endif
+
+ /* Initialize system malloc (needs __libc_initial to be set). */
+ call_function_static_weak (__ptmalloc_init);
}