Index: llvm/lib/ExecutionEngine/Orc/OrcABISupport.cpp =================================================================== --- llvm/lib/ExecutionEngine/Orc/OrcABISupport.cpp +++ llvm/lib/ExecutionEngine/Orc/OrcABISupport.cpp @@ -252,8 +252,13 @@ uint64_t *Stub = reinterpret_cast(StubsBlock.base()); uint64_t PtrOffsetField = static_cast(NumPages * PageSize - 6) << 16; + uint8_t StubCode[8] = { + 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, // jmpq *0x00 (%rip) + 0xC4, // invalid code: 0xC4, 0xF1 + 0xF1 + }; for (unsigned I = 0; I < NumStubs; ++I) - Stub[I] = 0xF1C40000000025ff | PtrOffsetField; + Stub[I] = *(uint64_t *)StubCode | PtrOffsetField; if (auto EC = sys::Memory::protectMappedMemory( StubsBlock, sys::Memory::MF_READ | sys::Memory::MF_EXEC))