Browse Source

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.
Robin Randhawa 6 năm trước cách đây
mục cha
commit
17bed54103
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/crti/src/lib.rs

+ 2 - 2
src/crti/src/lib.rs

@@ -30,7 +30,7 @@ global_asm!(r#"
     .global _init
     .global _init
     .type _init,%function
     .type _init,%function
     _init:
     _init:
-        stp x29,x30,[sp,-16]
+        stp x29,x30,[sp,-16]!
         mov x29,sp
         mov x29,sp
         // stp: "stores two doublewords from the first and second argument to memory addressed by addr"
         // 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
         // Body will be filled in by gcc and ended by crtn.o
@@ -39,7 +39,7 @@ global_asm!(r#"
     .global _fini
     .global _fini
     .type _fini,%function
     .type _fini,%function
     _fini:
     _fini:
-        stp x29,x30,[sp,-16]
+        stp x29,x30,[sp,-16]!
         mov x29,sp
         mov x29,sp
         // stp: "stores two doublewords from the first and second argument to memory addressed by addr"
         // 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
         // Body will be filled in by gcc and ended by crtn.o