Fix definition of _setjmp
The #pragma weak does not work, the symbol is not defined and when already defined, it is not made weak. Moreover, it does not make the symbol global so we need to declare it with a FUNCTION. If we want the symbol to be weak, then we should use .weak to do so. The _longjmp symbol should also be changed to match, in that case. Fixes #12912.
This commit is contained in:
@@ -19,6 +19,7 @@ FUNCTION_END(__sigsetjmp)
|
|||||||
|
|
||||||
/* int setjmp(jmp_buf buffer) */
|
/* int setjmp(jmp_buf buffer) */
|
||||||
FUNCTION(setjmp):
|
FUNCTION(setjmp):
|
||||||
|
FUNCTION(_setjmp):
|
||||||
stmia r0, {r0-r14}
|
stmia r0, {r0-r14}
|
||||||
mrs r1, cpsr
|
mrs r1, cpsr
|
||||||
str r1, [r0, #64]
|
str r1, [r0, #64]
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ FUNCTION_END(sigsetjmp)
|
|||||||
|
|
||||||
/* int setjmp(jmp_buf buffer) */
|
/* int setjmp(jmp_buf buffer) */
|
||||||
FUNCTION(setjmp):
|
FUNCTION(setjmp):
|
||||||
|
FUNCTION(_setjmp):
|
||||||
move.l (%a7)+,%a0
|
move.l (%a7)+,%a0
|
||||||
move.l (%a7)+,%d0
|
move.l (%a7)+,%d0
|
||||||
clr.l -(%a7) /* push 0 as 2nd arg */
|
clr.l -(%a7) /* push 0 as 2nd arg */
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ FUNCTION(sigsetjmp):
|
|||||||
|
|
||||||
/* int setjmp(jmp_buf buffer) */
|
/* int setjmp(jmp_buf buffer) */
|
||||||
FUNCTION(setjmp):
|
FUNCTION(setjmp):
|
||||||
|
FUNCTION(_setjmp):
|
||||||
// call __sigsetjmp with saveMask = 0
|
// call __sigsetjmp with saveMask = 0
|
||||||
addi %r4, 0, 0
|
addi %r4, 0, 0
|
||||||
b __sigsetjmp
|
b __sigsetjmp
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ FUNCTION_END(sigsetjmp)
|
|||||||
|
|
||||||
/* int setjmp(jmp_buf buffer) */
|
/* int setjmp(jmp_buf buffer) */
|
||||||
FUNCTION(setjmp):
|
FUNCTION(setjmp):
|
||||||
|
FUNCTION(_setjmp):
|
||||||
// prepare %edx, %ecx, and %eax for sigsetjmp
|
// prepare %edx, %ecx, and %eax for sigsetjmp
|
||||||
mov 0(%esp), %edx
|
mov 0(%esp), %edx
|
||||||
lea 4(%esp), %ecx
|
lea 4(%esp), %ecx
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ FUNCTION_END(setjmp)
|
|||||||
|
|
||||||
/* int setjmp(jmp_buf buffer) */
|
/* int setjmp(jmp_buf buffer) */
|
||||||
FUNCTION(setjmp):
|
FUNCTION(setjmp):
|
||||||
|
FUNCTION(_setjmp):
|
||||||
// Jump to sigsetjmp with a zero saveMask.
|
// Jump to sigsetjmp with a zero saveMask.
|
||||||
xorl %esi, %esi
|
xorl %esi, %esi
|
||||||
jmp sigsetjmp@PLT
|
jmp sigsetjmp@PLT
|
||||||
|
|||||||
Reference in New Issue
Block a user