summaryrefslogtreecommitdiff
path: root/src/signal/arm/sigsetjmp.s
AgeCommit message (Collapse)AuthorLines
2019-12-07arm: avoid conditional branch to PLT in sigsetjmpAndre McCurdy-2/+3
The R_ARM_THM_JUMP19 relocation type generated for the original code when targeting Thumb 2 is not supported by the gold linker.
2015-11-10explicitly assemble all arm asm sources as UALRich Felker-0/+1
these files are all accepted as legacy arm syntax when producing arm code, but legacy syntax cannot be used for producing thumb2 with access to the full ISA. even after switching to UAL, some asm source files contain instructions which are not valid in thumb mode, so these will need to be addressed separately.
2015-04-17redesign sigsetjmp so that signal mask is restored after longjmpRich Felker-9/+15
the conventional way to implement sigsetjmp is to save the signal mask then tail-call to setjmp; siglongjmp then restores the signal mask and calls longjmp. the problem with this approach is that a signal already pending, or arriving between unmasking of signals and restoration of the saved stack pointer, will have its signal handler run on the stack that was active before siglongjmp was called. this can lead to unbounded stack usage when siglongjmp is used to leave a signal handler. in the new design, sigsetjmp saves its own return address inside the extended part of the sigjmp_buf (outside the __jmp_buf part used by setjmp) then calls setjmp to save a jmp_buf inside its own execution. it then tail-calls to __sigsetjmp_tail, which uses the return value of setjmp to determine whether to save the current signal mask or restore a previously-saved mask. as an added bonus, this design makes it so that siglongjmp and longjmp are identical. this is useful because the __longjmp_chk function we need to add for ABI-compatibility assumes siglongjmp and longjmp are the same, but for different reasons -- it was designed assuming either can access a flag just past the __jmp_buf indicating whether the signal masked was saved, and act on that flag. however, early versions of musl did not have space past the __jmp_buf for the non-sigjmp_buf version of jmp_buf, so our setjmp cannot store such a flag without risking clobbering memory on (very) old binaries.
2014-04-02add __sigsetjmp ABI-compat alias for sigsetjmpRich Felker-0/+3
2012-07-02fix sigsetjmp on arm (needs asm)Rich Felker-0/+13
no idea why gcc refuses to compile the C code to use a tail call, but it's best to use asm anyway so we don't have to rely on the quality of the compiler's optimizations for correct code.