mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Replace __libc_multiple_libcs with __libc_initial flag
Change sbrk to fail for !__libc_initial (in the generic implementation). As a result, sbrk is (relatively) safe to use for the __libc_initial case (from the main libc). It is therefore no longer necessary to avoid using it in that case (or updating the brk cache), and the __libc_initial flag does not need to be updated as part of dlmopen or static dlopen. As before, direct brk system calls on Linux may lead to memory corruption. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
@ -18,8 +18,13 @@
|
||||
|
||||
#include <ctype.h>
|
||||
#include <libc-early-init.h>
|
||||
#include <libc-internal.h>
|
||||
#include <sys/single_threaded.h>
|
||||
|
||||
#ifdef SHARED
|
||||
_Bool __libc_initial;
|
||||
#endif
|
||||
|
||||
void
|
||||
__libc_early_init (_Bool initial)
|
||||
{
|
||||
@ -28,4 +33,8 @@ __libc_early_init (_Bool initial)
|
||||
|
||||
/* Only the outer namespace is marked as single-threaded. */
|
||||
__libc_single_threaded = initial;
|
||||
|
||||
#ifdef SHARED
|
||||
__libc_initial = initial;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user