Thorsten Glaser
2012-Sep-29 19:20 UTC
[klibc] [PATCH] fix trashing of callee-saved registers in thumb setjmp()
fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634890 (although dynamically-linked binaries seem to have another bug) Signed-off-by: Thorsten Glaser <tg at mirbsd.org> --- usr/klibc/arch/arm/setjmp.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr/klibc/arch/arm/setjmp.S b/usr/klibc/arch/arm/setjmp.S index d351e0e..92ffc43 100644 --- a/usr/klibc/arch/arm/setjmp.S +++ b/usr/klibc/arch/arm/setjmp.S @@ -70,6 +70,7 @@ longjmp: .type setjmp, #function .thumb_func setjmp: + mov r2, r0 mov r3, lr stmia r0!, {r3, r4, r5, r6, r7} mov r3, r8 @@ -78,6 +79,8 @@ setjmp: mov r6, fp mov r7, sp stmia r0!, {r3, r4, r5, r6, r7} + /* Do not trash r4 .. r7 */ + ldmia r2!, {r3, r4, r5, r6, r7} mov r0, #0 BX(lr) .size setjmp,.-setjmp -- 1.7.10.4
maximilian attems
2012-Oct-01 12:57 UTC
[klibc] [PATCH] fix trashing of callee-saved registers in thumb setjmp()
On Sat, 29 Sep 2012, Thorsten Glaser wrote:> fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634890 > (although dynamically-linked binaries seem to have another bug) > > Signed-off-by: Thorsten Glaser <tg at mirbsd.org> > --- > usr/klibc/arch/arm/setjmp.S | 3 +++ > 1 file changed, 3 insertions(+) >thanks, applied + pushed. -- maks