From a8629e6e77f14c989f7b1d55322373fb7c33ae2b Mon Sep 17 00:00:00 2001
From: whh8b <whh8b@git.zephyr-software.com>
Date: Mon, 11 Jan 2016 05:14:36 +0000
Subject: [PATCH] Give patch address even for initial placement.

---
 src/zipr.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/zipr.cpp b/src/zipr.cpp
index ed9bfa8..91e730b 100644
--- a/src/zipr.cpp
+++ b/src/zipr.cpp
@@ -1338,13 +1338,20 @@ void ZiprImpl_t::PlaceDollops()
 	{
 		Dollop_t *target_dollop = NULL;
 		UnresolvedUnpinned_t uu = (*pin_it).first;
+		Patch_t patch = (*pin_it).second;
 		Instruction_t *target_insn = NULL;
 
 		target_insn = uu.GetInstruction();
 		target_dollop = m_dollop_mgr.GetContainingDollop(target_insn);
 		assert(target_dollop);
 
-		placement_queue.push_back(pair<Dollop_t*,RangeAddress_t>(target_dollop,0));
+		placement_queue.push_back(pair<Dollop_t*,RangeAddress_t>(target_dollop,patch.GetAddress()));
+		if (m_verbose) {
+			cout << "Original: " << std::hex << target_insn->
+			                                    GetAddress()->
+			                                    GetVirtualOffset() << " "
+			     << "vs. Patch: " << std::hex << patch.GetAddress() << endl;
+		}
 	}
 
 	while (!placement_queue.empty())
-- 
GitLab