From 5381aa965313daeb5d7f2b5e38faa5d65e02fd21 Mon Sep 17 00:00:00 2001
From: Jason Hiser <jdhiser@gmail.com>
Date: Tue, 25 Dec 2018 09:40:43 -0500
Subject: [PATCH] removed (hopefully) unused pcrel-updating for x86

---
 src/zipr.cpp | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/zipr.cpp b/src/zipr.cpp
index 75cdd8e..a299f6e 100644
--- a/src/zipr.cpp
+++ b/src/zipr.cpp
@@ -129,10 +129,15 @@ void ZiprImpl_t::Init()
 	}
 	plugman = ZiprPluginManager_t(this, &m_zipr_options);
 
-	archhelper=ZiprArchitectureHelperBase_t::factory(this);
-	pinner =archhelper->getPinner ();
-	patcher=archhelper->getPatcher();
-	sizer  =archhelper->getSizer  ();
+	// need a file IR to create the arch-specific stuff.
+	// without it, we won't run anything anyhow
+	if(m_firp)
+	{
+		archhelper=ZiprArchitectureHelperBase_t::factory(this);
+		pinner =archhelper->getPinner ();
+		patcher=archhelper->getPatcher();
+		sizer  =archhelper->getSizer  ();
+	}
 
 	/*
 	 * Parse again now that the plugins registered something.
@@ -1798,7 +1803,6 @@ RangeAddress_t ZiprImpl_t::PlopDollopEntry(
 {
 	Instruction_t *insn = entry->Instruction();
 	RangeAddress_t ret = entry->Place(), addr = entry->Place();
-	string raw_data, orig_data; 
 
 	assert(insn);
 
@@ -1807,8 +1811,10 @@ RangeAddress_t ZiprImpl_t::PlopDollopEntry(
 
 	const auto d=DecodedInstruction_t(insn);
 
-	raw_data = insn->GetDataBits();
-	orig_data = insn->GetDataBits();
+	string raw_data = insn->GetDataBits();
+	string orig_data = insn->GetDataBits();
+
+#if 0
 
 	const auto operands=d.getOperands();
 	const auto is_instr_relative_it = find_if(ALLOF(operands),[](const DecodedOperand_t& op)
@@ -1869,6 +1875,7 @@ RangeAddress_t ZiprImpl_t::PlopDollopEntry(
 		raw_data.replace(0, raw_data.length(), instr_raw, raw_data.length());
 		insn->SetDataBits(raw_data);
 	}
+#endif
 
 	if(entry->TargetDollop() && entry->Instruction()->GetCallback()=="")
 	{
-- 
GitLab