From b24d743f62106accb3720e482c32571a0cb2defb Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Mon, 19 Oct 2015 12:56:50 -0700 Subject: [PATCH] Remove deprecated use of ldm/stm in ARM setjmp. ARM deprecates using the SP register in the register lists for ldm and stm, which LLVM emits a warning for. Bug: http://b/25017080 Change-Id: Ib427e3dfd5740e251f1ad91ebb66534e0d7b72a9 --- libc/arch-arm/bionic/setjmp.S | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libc/arch-arm/bionic/setjmp.S b/libc/arch-arm/bionic/setjmp.S index a119529ee..464f7d8de 100644 --- a/libc/arch-arm/bionic/setjmp.S +++ b/libc/arch-arm/bionic/setjmp.S @@ -151,7 +151,10 @@ ENTRY(sigsetjmp) // Save core registers. add r1, r0, #(_JB_CORE_BASE * 4) m_mangle_registers r2 - stmia r1, {r4-r14} + + // ARM deprecates using sp in the register list for stmia. + stmia r1, {r4-r12, lr} + str sp, [r1, #(10 * 4)] m_unmangle_registers r2 // Save floating-point registers. @@ -204,7 +207,10 @@ ENTRY(siglongjmp) ldr r3, [r0, #(_JB_SIGFLAG * 4)] bic r3, r3, #1 add r2, r0, #(_JB_CORE_BASE * 4) - ldmia r2, {r4-r14} + + // ARM deprecates using sp in the register list for ldmia. + ldmia r2, {r4-r12, lr} + ldr sp, [r2, #(10 * 4)] m_unmangle_registers r3 // Save the return value/address and check the setjmp cookie.