diff --git a/src/asmjit/x86/x86assembler.cpp b/src/asmjit/x86/x86assembler.cpp index 6a0f76a..7985aef 100644 --- a/src/asmjit/x86/x86assembler.cpp +++ b/src/asmjit/x86/x86assembler.cpp @@ -3800,6 +3800,7 @@ EmitModSib_LabelRip_X86: err = _code->newRelocEntry(&re, RelocEntry::kTypeRelToAbs, 4); if (ASMJIT_UNLIKELY(err)) goto Failed; + re->_sourceSectionId = _section->getId(); re->_sourceOffset = static_cast((uintptr_t)(cursor - _bufferData)); re->_data = static_cast(relOffset); @@ -3820,9 +3821,9 @@ EmitModSib_LabelRip_X86: err = _code->newRelocEntry(&re, RelocEntry::kTypeRelToAbs, 4); if (ASMJIT_UNLIKELY(err)) goto Failed; + re->_sourceSectionId = _section->getId(); re->_sourceOffset = static_cast((uintptr_t)(cursor - _bufferData)); - re->_data = re->_sourceOffset + - static_cast(static_cast(relOffset)); + re->_data = re->_sourceOffset + static_cast(static_cast(relOffset)); EMIT_32(0); } } @@ -4327,7 +4328,9 @@ EmitJmpCall: err = _code->newRelocEntry(&re, RelocEntry::kTypeAbsToRel, 0); if (ASMJIT_UNLIKELY(err)) goto Failed; + re->_sourceSectionId = _section->getId(); re->_data = static_cast(jumpAddress); + if (ASMJIT_LIKELY(opCode)) { // 64-bit: Emit REX prefix so the instruction can be patched later. // REX prefix does nothing if not patched, but allows to patch the