Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: src/IceInstX8664.cpp

Issue 1669443002: Subzero. Uses fixups to calculate addend to relocations. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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");
}

Powered by Google App Engine
This is Rietveld 408576698