From 17bed5410358eb96741be2db29d624198cfdd183 Mon Sep 17 00:00:00 2001 From: Robin Randhawa Date: Mon, 25 Feb 2019 19:12:49 +0000 Subject: [PATCH] aarch64: Fix incorrect init/fini stack manipulation The pre-index operator ('!') was missing at the end of the stp instruction. As a result, the stack pointer wasn't updated after the store of the 64-bit pair and the stored values were basically lost when follow on code used the stack for later store ops. --- src/crti/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crti/src/lib.rs b/src/crti/src/lib.rs index 9843734faf..eb80c7c57a 100644 --- a/src/crti/src/lib.rs +++ b/src/crti/src/lib.rs @@ -30,7 +30,7 @@ global_asm!(r#" .global _init .type _init,%function _init: - stp x29,x30,[sp,-16] + stp x29,x30,[sp,-16]! mov x29,sp // stp: "stores two doublewords from the first and second argument to memory addressed by addr" // Body will be filled in by gcc and ended by crtn.o @@ -39,7 +39,7 @@ global_asm!(r#" .global _fini .type _fini,%function _fini: - stp x29,x30,[sp,-16] + stp x29,x30,[sp,-16]! mov x29,sp // stp: "stores two doublewords from the first and second argument to memory addressed by addr" // Body will be filled in by gcc and ended by crtn.o