glibc/sysdeps
Florian Weimer 035c012e32 Reduce the statically linked startup code [BZ #23323]
It turns out the startup code in csu/elf-init.c has a perfect pair of
ROP gadgets (see Marco-Gisbert and Ripoll-Ripoll, "return-to-csu: A
New Method to Bypass 64-bit Linux ASLR").  These functions are not
needed in dynamically-linked binaries because DT_INIT/DT_INIT_ARRAY
are already processed by the dynamic linker.  However, the dynamic
linker skipped the main program for some reason.  For maximum
backwards compatibility, this is not changed, and instead, the main
map is consulted from __libc_start_main if the init function argument
is a NULL pointer.

For statically linked binaries, the old approach based on linker
symbols is still used because there is nothing else available.

A new symbol version __libc_start_main@@GLIBC_2.34 is introduced because
new binaries running on an old libc would not run their ELF
constructors, leading to difficult-to-debug issues.
2021-02-25 12:13:02 +01:00
..
aarch64 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
alpha Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
arc Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
arm Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
csky Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
generic Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
gnu
hppa Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
htl
hurd
i386 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
ia64 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
ieee754
m68k Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
mach Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
microblaze Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
mips Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
nios2 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
nptl nptl: Move elision implementations into libc 2021-02-23 14:59:34 +01:00
posix
powerpc Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
pthread nptl: Move elision implementations into libc 2021-02-23 14:59:34 +01:00
riscv Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
s390 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
sh Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
sparc Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
unix Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
wordsize-32
wordsize-64
x86 x86: Use x86/nptl/pthreaddef.h 2021-02-22 15:52:56 -08:00
x86_64 Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00