[PATCH] D53673: [COFF, ARM64] Implement Intrinsic.sponentry for AArch64

Yin Ma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 25 10:54:28 PDT 2018


yinma added a comment.

Because __security_push_cookie has extra 0x10 subtraction on SP, if you removes buf[100], you will see no security_push_cookie is used. it will be sp on entry.

__security_push_cookie:

  000000014000D680: D10043FF  sub         sp,sp,#0x10
  000000014000D684: F0000471  adrp        xip1,__scrt_native_dllmain_reason
  000000014000D688: 91002231  add         xip1,xip1,#8
  000000014000D68C: F9400231  ldr         xip1,[xip1]
  000000014000D690: CB3163F1  sub         xip1,sp,xip1
  000000014000D694: F90007F1  str         xip1,[sp,#8]
  000000014000D698: D65F03C0  ret

__security_pop_cookie:

  000000014000D69C: F0000471  adrp        xip1,__scrt_native_dllmain_reason
  000000014000D6A0: 91002231  add         xip1,xip1,#8
  000000014000D6A4: F94007F0  ldr         xip0,[sp,#8]
  000000014000D6A8: F9400231  ldr         xip1,[xip1]
  000000014000D6AC: CB3063F0  sub         xip0,sp,xip0
  000000014000D6B0: EB11021F  cmp         xip0,xip1
  000000014000D6B4: 54000061  bne         000000014000D6C0
  000000014000D6B8: 910043FF  add         sp,sp,#0x10
  000000014000D6BC: D65F03C0  ret
  000000014000D6C0: AA1003E0  mov         x0,xip0


Repository:
  rL LLVM

https://reviews.llvm.org/D53673





More information about the llvm-commits mailing list