Skip to content

Commit 5ca50a2

Browse files
committed
Add stack overflow example for Linux AArch64
1 parent e623b46 commit 5ca50a2

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

NativeStackOverflow/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 3.10)
22
project(NativeStackOverflow C ASM)
33

44
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
5-
set(ASM_SRC NativeOverflow.s)
5+
set(ASM_SRC NativeOverflow-x86_64.s)
6+
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
7+
set(ASM_SRC NativeOverflow-aarch64.s)
68
else()
79
message(FATAL_ERROR "Unsupported processor:" ${CMAKE_SYSTEM_PROCESSOR})
810
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.global Java_NativeStackOverflow_doOverflow
2+
.type Java_NativeStackOverflow_doOverflow, @function
3+
4+
Java_NativeStackOverflow_doOverflow:
5+
stp x29, x30, [sp, #-16]
6+
mov x29, sp
7+
8+
1:
9+
stp xzr, xzr, [sp, #-16]!
10+
b 1b

NativeStackOverflow/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# 対応環境
88

99
* Linux x86_64
10+
* Linux AArch64
1011

1112
# ネイティブレベルのスタックオーバーフローの起こし方
1213

0 commit comments

Comments
 (0)