Index: src/IceInstX8664.cpp |
diff --git a/src/IceInstX8664.cpp b/src/IceInstX8664.cpp |
index 7bac57ebe1e6f6f14c711317160627ebe45d4819..ca2acfa128f08640b171fbf233c2072a0131ef78 100644 |
--- a/src/IceInstX8664.cpp |
+++ b/src/IceInstX8664.cpp |
@@ -268,14 +268,14 @@ TargetX8664Traits::Address TargetX8664Traits::X86OperandMem::toAsmAddress( |
Disp += static_cast<int32_t>(CI->getValue()); |
} else if (const auto *CR = |
llvm::dyn_cast<ConstantRelocatable>(getOffset())) { |
- RelocOffsetT DispAdjustment = 0; |
if (CR->getName() != "") { |
const auto FixupKind = |
(getBase() != nullptr || getIndex() != nullptr) ? FK_Abs : FK_PcRel; |
- DispAdjustment = FixupKind == FK_PcRel ? 4 : 0; |
+ const RelocOffsetT DispAdjustment = FixupKind == FK_PcRel ? 4 : 0; |
Fixup = Asm->createFixup(FixupKind, CR); |
+ Fixup->set_addend(-DispAdjustment); |
} |
- Disp = CR->getOffset() - DispAdjustment; |
+ Disp = CR->getOffset(); |
} else { |
llvm_unreachable("Unexpected offset type"); |
} |