glibc/sysdeps
H.J. Lu 354cabcb26 x86-64: Allocate state buffer space for RDI, RSI and RBX
_dl_tlsdesc_dynamic preserves RDI, RSI and RBX before realigning stack.
After realigning stack, it saves RCX, RDX, R8, R9, R10 and R11.  Define
TLSDESC_CALL_REGISTER_SAVE_AREA to allocate space for RDI, RSI and RBX
to avoid clobbering saved RDI, RSI and RBX values on stack by xsave to
STATE_SAVE_OFFSET(%rsp).

   +==================+<- stack frame start aligned at 8 or 16 bytes
   |                  |<- RDI saved in the red zone
   |                  |<- RSI saved in the red zone
   |                  |<- RBX saved in the red zone
   |                  |<- paddings for stack realignment of 64 bytes
   |------------------|<- xsave buffer end aligned at 64 bytes
   |                  |<-
   |                  |<-
   |                  |<-
   |------------------|<- xsave buffer start at STATE_SAVE_OFFSET(%rsp)
   |                  |<- 8-byte padding for 64-byte alignment
   |                  |<- 8-byte padding for 64-byte alignment
   |                  |<- R11
   |                  |<- R10
   |                  |<- R9
   |                  |<- R8
   |                  |<- RDX
   |                  |<- RCX
   +==================+<- RSP aligned at 64 bytes

Define TLSDESC_CALL_REGISTER_SAVE_AREA, the total register save area size
for all integer registers by adding 24 to STATE_SAVE_OFFSET since RDI, RSI
and RBX are saved onto stack without adjusting stack pointer first, using
the red-zone.  This fixes BZ #31501.
Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>

(cherry picked from commit 717ebfa85c)
2024-04-01 11:16:14 -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 x86-64: Update _dl_tlsdesc_dynamic to preserve AMX registers 2024-04-01 10:55:17 -07: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-64: Allocate state buffer space for RDI, RSI and RBX 2024-04-01 11:16:14 -07:00
x86_64 x86-64: Allocate state buffer space for RDI, RSI and RBX 2024-04-01 11:16:14 -07:00