mirror of git://sourceware.org/git/glibc.git
malloc: Fix malloc init order
__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>
This commit is contained in:
parent
a289cf711e
commit
919bf1489a
|
|
@ -33,9 +33,6 @@ _Bool __libc_initial;
|
||||||
void
|
void
|
||||||
__libc_early_init (_Bool initial)
|
__libc_early_init (_Bool initial)
|
||||||
{
|
{
|
||||||
/* Initialize system malloc. */
|
|
||||||
call_function_static_weak (__ptmalloc_init);
|
|
||||||
|
|
||||||
/* Initialize ctype data. */
|
/* Initialize ctype data. */
|
||||||
__ctype_init ();
|
__ctype_init ();
|
||||||
|
|
||||||
|
|
@ -53,4 +50,7 @@ __libc_early_init (_Bool initial)
|
||||||
#if ENABLE_ELISION_SUPPORT
|
#if ENABLE_ELISION_SUPPORT
|
||||||
__lll_elision_init ();
|
__lll_elision_init ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Initialize system malloc (needs __libc_initial to be set). */
|
||||||
|
call_function_static_weak (__ptmalloc_init);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue