From: Rich Felker Date: Tue, 28 Apr 2015 00:03:28 +0000 (-0400) Subject: fix sh jmp_buf size to match ABI X-Git-Tag: v1.1.9~15 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=85d12e02858545f8942a9c5c9f0eddc2da75edce;p=oweals%2Fmusl.git fix sh jmp_buf size to match ABI while the sh port is still experimental and subject to ABI instability, this is not actually an application/libc boundary ABI change. it only affects third-party APIs where jmp_buf is used in a shared structure at the ABI boundary, because nothing anywhere near the end of the jmp_buf object (which includes the oversized sigset_t) is accessed by libc. both glibc and uclibc have 15-slot jmp_buf for sh. presumably the smaller version was used in musl because the slots for fpu status register and thread pointer register (gbr) were incorrect and must not be restored by longjmp, but the size should have been preserved, as it's generally treated as a libc-agnostic ABI property for the arch, and having extra slots free in case we ever need them for something is useful anyway. --- diff --git a/arch/sh/bits/setjmp.h b/arch/sh/bits/setjmp.h index bef7fe2a..05dbdc71 100644 --- a/arch/sh/bits/setjmp.h +++ b/arch/sh/bits/setjmp.h @@ -1 +1 @@ -typedef unsigned long __jmp_buf[13]; +typedef unsigned long __jmp_buf[15]; diff --git a/src/signal/sh/sigsetjmp.s b/src/signal/sh/sigsetjmp.s index 16256e5f..1e2270be 100644 --- a/src/signal/sh/sigsetjmp.s +++ b/src/signal/sh/sigsetjmp.s @@ -8,7 +8,7 @@ __sigsetjmp: bt 9f mov r4, r6 - add #52, r6 + add #60, r6 sts pr, r0 mov.l r0, @r6 mov.l r8, @(4+8,r6) @@ -20,7 +20,7 @@ __sigsetjmp: mov r0, r5 mov r8, r4 mov r4, r6 - add #52, r6 + add #60, r6 mov.l @r6, r0 lds r0, pr