Replace __libc_multiple_libcs with __libc_initial flag
authorFlorian Weimer <fweimer@redhat.com>
Wed, 16 Dec 2020 14:09:52 +0000 (15:09 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 16 Dec 2020 14:13:40 +0000 (15:13 +0100)
commite7570f4131a6af9405af7b4fd1c31de807e7cf68
tree0f11050a7a1b768fb0d683dc60412bc2a101c3a5
parent9459fe9da0f981f77ba931790f82e43ac552b73c
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>
csu/init-first.c
csu/libc-start.c
elf/dl-open.c
elf/dl-sysdep.c
elf/libc_early_init.c
include/libc-internal.h
misc/sbrk.c
sysdeps/mach/hurd/dl-sysdep.c
sysdeps/mach/hurd/i386/init-first.c