mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-05 19:21:05 +00:00
8b8a692cfd
This updates glibc for the changes in the ELFv2 relating to the stack frame layout. These are described in more detail here: http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html Specifically, the "compiler and linker doublewords" were removed, which has the effect that the save slot for the TOC register is now at offset 24 rather than 40 to the stack pointer. In addition, a function may now no longer necessarily assume that its caller has set up a 64-byte register save area its use. To address the first change, the patch goes through all assembler files and replaces immediate offsets in instructions accessing the ABI-defined stack slots by symbolic offsets. Those already were defined in ucontext_i.sym and used in some of the context routines, but that doesn't really seem like the right place for those defines. The patch instead defines those symbolic offsets in sysdeps.h, in two variants for the old and new ABI, and uses them systematically in all assembler files, not just the context routines. The second change only affected a few assembler files that used the save area to temporarily store some registers. In those cases where this happens within a leaf function, this patch changes the code to store those registers to the "red zone" below the stack pointer. Otherwise, the functions already allocate a stack frame, and the patch changes them to add extra space in these frames as temporary space for the ELFv2 ABI.
30 lines
874 B
Plaintext
30 lines
874 B
Plaintext
#include <stddef.h>
|
|
#include <signal.h>
|
|
#include <sys/ucontext.h>
|
|
|
|
--
|
|
|
|
SIG_BLOCK
|
|
SIG_SETMASK
|
|
|
|
|
|
-- Offsets of the fields in the ucontext_t structure.
|
|
#define ucontext(member) offsetof (ucontext_t, member)
|
|
#define mcontext(member) ucontext (uc_mcontext.member)
|
|
|
|
UCONTEXT_LINK ucontext (uc_link)
|
|
UCONTEXT_STACK ucontext (uc_stack)
|
|
UCONTEXT_STACK_SP ucontext (uc_stack.ss_sp)
|
|
UCONTEXT_STACK_FLAGS ucontext (uc_stack.ss_flags)
|
|
UCONTEXT_STACK_SIZE ucontext (uc_stack.ss_size)
|
|
UCONTEXT_SIGMASK ucontext (uc_sigmask)
|
|
UCONTEXT_MCONTEXT ucontext (uc_mcontext)
|
|
SIGCONTEXT_SIGNAL mcontext (signal)
|
|
SIGCONTEXT_HANDLER mcontext (handler)
|
|
SIGCONTEXT_OLDMASK mcontext (oldmask)
|
|
SIGCONTEXT_PT_REGS mcontext (regs)
|
|
SIGCONTEXT_GP_REGS mcontext (gp_regs)
|
|
SIGCONTEXT_FP_REGS mcontext (fp_regs)
|
|
SIGCONTEXT_V_REGS_PTR mcontext (v_regs)
|
|
SIGCONTEXT_V_RESERVE mcontext (vmx_reserve)
|