I am trying to call malloc from iOS arm64 assembly .s file, However calling _test_malloc from *.m file, it does not return from _test_malloc() (running this on iPhone5s)
What am I misunderstanding ?
//test_malloc.s
.private_extern _test_malloc
.globl _test_malloc
.align 2
_test_malloc:
mov x0, #8
bl _malloc //wordPtr = malloc(8)
ret
//run_test_malloc.m
extern uint32_t* test_malloc();
static void run_test_malloc() {
uint32_t* ptr = test_malloc();
}