From 29d28408d30f6a9ee14ad0a6d80ce99f516a5e2f Mon Sep 17 00:00:00 2001
From: an7s <an7s@git.zephyr-software.com>
Date: Wed, 13 May 2015 01:08:16 +0000
Subject: [PATCH] fixed bug where we were pinning a NULL entry point

Former-commit-id: 3d50b3532b12c8232424797c0dbac8ec5fee4383
---
 tools/cinderella/cinderella_prep.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/cinderella/cinderella_prep.cpp b/tools/cinderella/cinderella_prep.cpp
index a58d8db3c..77ecde9be 100644
--- a/tools/cinderella/cinderella_prep.cpp
+++ b/tools/cinderella/cinderella_prep.cpp
@@ -37,7 +37,7 @@ void CinderellaPrep::pinAllFunctionEntryPoints()
 		if (!fn) continue;
 		Instruction_t *insn = fn->GetEntryPoint();
 		
-		if(insn && insn->GetAddress())
+		if(insn && insn->GetAddress() && insn->GetAddress()->GetVirtualOffset() > 0)
 		{
 			insn->SetIndirectBranchTargetAddress(insn->GetAddress());
 printf("inferfn: pinning function entry point: %p\n", insn->GetAddress()->GetVirtualOffset());
-- 
GitLab