diff --git a/Utilities/JITLLVM.cpp b/Utilities/JITLLVM.cpp index 0a1038f61e..c88be65938 100644 --- a/Utilities/JITLLVM.cpp +++ b/Utilities/JITLLVM.cpp @@ -110,18 +110,21 @@ static u64 make_null_function(const std::string& name) c.align(AlignMode::kData, 16); #else // AArch64 implementation - Label jmp_address = c.newLabel(); Label data = c.newLabel(); - // Force absolute jump to prevent out of bounds PC-rel jmp - c.ldr(args[0], arm::ptr(jmp_address)); - c.br(args[0]); - c.align(AlignMode::kCode, 16); + Label jump_address = c.newLabel(); + c.ldr(args[0], arm::ptr(data, 0)); + c.ldr(a64::x14, arm::ptr(jump_address, 0)); + c.br(a64::x14); + // Data frame + c.align(AlignMode::kCode, 16); + c.bind(jump_address); + c.embedUInt64(reinterpret_cast(&null)); + + c.align(AlignMode::kData, 16); c.bind(data); c.embed(name.c_str(), name.size()); c.embedUInt8(0U); - c.bind(jmp_address); - c.embedUInt64(reinterpret_cast(&null)); c.align(AlignMode::kData, 16); #endif });