glibc/sysdeps
H.J. Lu 0aac205a81 x86: Update _dl_tlsdesc_dynamic to preserve caller-saved registers
Compiler generates the following instruction sequence for GNU2 dynamic
TLS access:

	leaq	tls_var@TLSDESC(%rip), %rax
	call	*tls_var@TLSCALL(%rax)

or

	leal	tls_var@TLSDESC(%ebx), %eax
	call	*tls_var@TLSCALL(%eax)

CALL instruction is transparent to compiler which assumes all registers,
except for EFLAGS and RAX/EAX, are unchanged after CALL.  When
_dl_tlsdesc_dynamic is called, it calls __tls_get_addr on the slow
path.  __tls_get_addr is a normal function which doesn't preserve any
caller-saved registers.  _dl_tlsdesc_dynamic saved and restored integer
caller-saved registers, but didn't preserve any other caller-saved
registers.  Add _dl_tlsdesc_dynamic IFUNC functions for FNSAVE, FXSAVE,
XSAVE and XSAVEC to save and restore all caller-saved registers.  This
fixes BZ #31372.

Add GLRO(dl_x86_64_runtime_resolve) with GLRO(dl_x86_tlsdesc_dynamic)
to optimize elf_machine_runtime_setup.
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2024-02-28 09:02:56 -08:00
..
aarch64 aarch64/fpu: Sync libmvec routines from 2.39 and before with AOR 2024-02-26 09:45:50 -03:00
alpha string: Use builtins for ffs and ffsll 2024-02-01 09:31:33 -03:00
arc string: Use builtins for ffs and ffsll 2024-02-01 09:31:33 -03:00
arm arm: Use _dl_find_object on __gnu_Unwind_Find_exidx (BZ 31405) 2024-02-23 08:50:00 -03:00
csky Refer to C23 in place of C2X in glibc 2024-02-01 11:02:01 +00:00
generic string: Use builtins for ffs and ffsll 2024-02-01 09:31:33 -03:00
gnu Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
hppa Refer to C23 in place of C2X in glibc 2024-02-01 11:02:01 +00:00
htl Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
hurd Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
i386 x86: Update _dl_tlsdesc_dynamic to preserve caller-saved registers 2024-02-28 09:02:56 -08:00
ieee754 Rename c2x / gnu2x tests to c23 / gnu23 2024-02-01 17:55:57 +00:00
loongarch Apply the Makefile sorting fix 2024-02-15 11:19:56 -08:00
m68k string: Use builtins for ffs and ffsll 2024-02-01 09:31:33 -03:00
mach Implement setcontext/getcontext/makecontext/swapcontext for Hurd x86_64 2024-02-17 21:45:35 +01:00
microblaze Refer to C23 in place of C2X in glibc 2024-02-01 11:02:01 +00:00
mips math: Update mips64 ulps 2024-02-22 21:28:25 +01:00
nios2 Refer to C23 in place of C2X in glibc 2024-02-01 11:02:01 +00:00
nptl Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
or1k Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
posix Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
powerpc powerpc: Remove power7 strstr optimization 2024-02-23 08:50:00 -03:00
pthread Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
riscv Refer to C23 in place of C2X in glibc 2024-02-01 11:02:01 +00:00
s390 s390: Improve static-pie configure tests 2024-02-28 10:09:53 -03:00
sh Refer to C23 in place of C2X in glibc 2024-02-01 11:02:01 +00:00
sparc sparc: Treat the version field in the FPU control word as reserved 2024-02-19 10:55:50 -03:00
unix sysdeps/unix/sysv/linux/x86_64/Makefile: Add the end marker 2024-02-28 05:48:27 -08:00
wordsize-32 Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
wordsize-64 Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
x86 x86: Update _dl_tlsdesc_dynamic to preserve caller-saved registers 2024-02-28 09:02:56 -08:00
x86_64 x86: Update _dl_tlsdesc_dynamic to preserve caller-saved registers 2024-02-28 09:02:56 -08:00