diff --git a/src/processor_arm.cpp b/src/processor_arm.cpp index 000894fb05d7d..7b5fe0003bb56 100644 --- a/src/processor_arm.cpp +++ b/src/processor_arm.cpp @@ -522,8 +522,8 @@ static inline unsigned long jl_getauxval(unsigned long type) { // First, try resolving getauxval in libc auto libc = jl_dlopen(nullptr, JL_RTLD_LOCAL); - static (unsigned long (*)(unsigned long) getauxval_p; - if (jl_dlsym(libc, "getauxval", &getauxval_p, 0) { + static unsigned long (*getauxval_p)(unsigned long) = NULL; + if (getauxval_p == NULL && jl_dlsym(libc, "getauxval", (void **)&getauxval_p, 0)) { return getauxval_p(type); } diff --git a/src/task.c b/src/task.c index 3dce377a01a89..b54bbbc2df32b 100644 --- a/src/task.c +++ b/src/task.c @@ -762,7 +762,9 @@ static void jl_start_fiber(jl_ucontext_t *lastt, jl_ucontext_t *t) asm(" mov sp, %0;\n" " mov lr, #0;\n" // Clear link register (lr) and frame pointer " mov fp, #0;\n" // (fp) to terminate unwinder. - " br %1;\n" // call `fn` with fake stack frame + " bx %1;\n" // call `fn` with fake stack frame. While `bx` can change + // the processor mode to thumb, this will never happen + // because all our addresses are word-aligned. " udf #0" // abort : : "r" (stk), "r"(fn) : "memory" ); #else