glibc/sysdeps
H.J. Lu a364304718 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>

(cherry picked from commit 0aac205a81)
2024-04-01 10:42:25 -07:00
..
aarch64 aarch64: Make cpu-features definitions not Linux-specific 2024-01-04 23:48:54 +01:00
alpha Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
arc Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
arm arm: Remove wrong ldr from _dl_start_user (BZ 31339) 2024-02-05 15:43:39 -03:00
csky Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
generic powerpc: Add HWCAP3/HWCAP4 data to TCB for Power Architecture. 2024-03-20 18:09:32 -05:00
gnu Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
hppa Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08: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-04-01 10:42:25 -07:00
ieee754 math: remove exp10 wrappers 2024-01-12 16:02:12 +00:00
loongarch LoongArch: Correct {__ieee754, _}_scalb -> {__ieee754, _}_scalbf 2024-03-22 09:29:44 +08:00
m68k math: remove exp10 wrappers 2024-01-12 16:02:12 +00:00
mach Make __getrandom_nocancel set errno and add a _nostatus version 2024-01-12 14:23:11 +01:00
microblaze Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
mips math: Update mips64 ulps 2024-02-22 21:29:26 +01:00
nios2 Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08: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: Placeholder and infrastructure/build support to add Power11 related changes. 2024-03-20 19:43:40 -05:00
pthread Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
riscv riscv: add support for static PIE 2024-01-22 14:58:23 +01:00
s390 S390: Fix building with --disable-mutli-arch [BZ #31196] 2024-01-30 22:28:51 +01:00
sh Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
sparc sparc: Fix sparc64 memmove length comparison (BZ 31266) 2024-01-22 09:34:50 -03:00
unix powerpc: Add HWCAP3/HWCAP4 data to TCB for Power Architecture. 2024-03-20 18:09:32 -05: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-04-01 10:42:25 -07:00
x86_64 x86: Update _dl_tlsdesc_dynamic to preserve caller-saved registers 2024-04-01 10:42:25 -07:00