diff --git a/ndk/platforms/android-3/arch-arm/src/crtbegin_dynamic.S b/ndk/platforms/android-3/arch-arm/src/crtbegin_dynamic.S index ec6d482d8..c7c9f6d55 100644 --- a/ndk/platforms/android-3/arch-arm/src/crtbegin_dynamic.S +++ b/ndk/platforms/android-3/arch-arm/src/crtbegin_dynamic.S @@ -53,6 +53,7 @@ _start: ldr r2, =main adr r3, 1f ldr r4, =__libc_init +# Use blx intead of bx so stack unwinding past __libc_init can terminate at _start blx r4 mov r0, #0 bx r0 diff --git a/ndk/platforms/android-3/arch-arm/src/crtbegin_static.S b/ndk/platforms/android-3/arch-arm/src/crtbegin_static.S index d9d12a786..62ed4bbcc 100644 --- a/ndk/platforms/android-3/arch-arm/src/crtbegin_static.S +++ b/ndk/platforms/android-3/arch-arm/src/crtbegin_static.S @@ -53,6 +53,7 @@ _start: ldr r2, =main adr r3, 1f ldr r4, =__libc_init +# Use blx intead of bx so stack unwinding past __libc_init can terminate at _start blx r4 mov r0, #0 bx r0 diff --git a/ndk/platforms/android-9/arch-mips/src/crtbegin_dynamic.S b/ndk/platforms/android-9/arch-mips/src/crtbegin_dynamic.S index 28f8fd551..be42fb227 100644 --- a/ndk/platforms/android-9/arch-mips/src/crtbegin_dynamic.S +++ b/ndk/platforms/android-9/arch-mips/src/crtbegin_dynamic.S @@ -64,6 +64,7 @@ _start: la $a3, 1f subu $sp, 32 la $t9, __libc_init +# Use jalr intead of jr so stack unwinding past __libc_init can terminate at _start jalr $t9 move $t9, $0 j $t9 diff --git a/ndk/platforms/android-9/arch-mips/src/crtbegin_static.S b/ndk/platforms/android-9/arch-mips/src/crtbegin_static.S index 893863c17..58bab827f 100644 --- a/ndk/platforms/android-9/arch-mips/src/crtbegin_static.S +++ b/ndk/platforms/android-9/arch-mips/src/crtbegin_static.S @@ -64,6 +64,7 @@ _start: la $a3, 1f subu $sp, 32 la $t9, __libc_init +# Use jalr intead of jr so stack unwinding past __libc_init can terminate at _start jalr $t9 move $t9, $0 j $t9