From 8c13b28160753c559940d2b841802d0ff4ed6657 Mon Sep 17 00:00:00 2001
From: Jason Hiser <jdh8d@ip-172-31-20-24.ec2.internal>
Date: Fri, 1 Mar 2019 21:51:30 +0000
Subject: [PATCH] fixed tbss problem

---
 src/elfwrite.cpp | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/elfwrite.cpp b/src/elfwrite.cpp
index f690d125f..7651deca1 100644
--- a/src/elfwrite.cpp
+++ b/src/elfwrite.cpp
@@ -92,13 +92,20 @@ VirtualOffset_t ElfWriter::DetectMaxAddr(const ELFIO::elfio *elfiop, FileIR_t* f
 void ElfWriter::CreatePagemap(const ELFIO::elfio *elfiop, FileIR_t* firp, const string &out_file)
 {
 
-	for(DataScoopSet_t::iterator it=firp->getDataScoops().begin(); it!=firp->getDataScoops().end(); ++it)
-	{
-		DataScoop_t* scoop=*it;
+// 	for(DataScoopSet_t::iterator it=firp->getDataScoops().begin(); it!=firp->getDataScoops().end(); ++it)
+// 		DataScoop_t* scoop=*it;
+//
+	for(auto scoop : firp->getDataScoops())
+	{
+		// tbss is an elf-byproduct that irdb doesn't entirely support.  
+		// IRDB needs a better mechanism.
+		// To support this for now, we can just ignore it here.
+		if(scoop->getName()==".tbss")
+			continue;
 
-		AddressID_t* scoop_addr=scoop->getStart();
-		VirtualOffset_t start_addr=scoop_addr->getVirtualOffset();
-		VirtualOffset_t end_addr=scoop->getEnd()->getVirtualOffset();
+		auto scoop_addr=scoop->getStart();
+		auto start_addr=scoop_addr->getVirtualOffset();
+		auto end_addr=scoop->getEnd()->getVirtualOffset();
 
 		// we'll deal with unpinned scoops later.
 		if(scoop_addr->getVirtualOffset()==0)
-- 
GitLab