[PATCH] gold: Don't combine sections with non-zero/zero flags

H.J. Lu hjl.tools@gmail.com
Mon Jun 24 19:53:00 GMT 2019


Gold shouldn't combine sections with non-zero flags and zero flags.

	PR gold/17556
	* layout.cc (Layout::get_output_section): Don't combine sections
	with non-zero flags and zero flags.
---
 gold/layout.cc | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/gold/layout.cc b/gold/layout.cc
index 73642b6b61..52908e92c1 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -868,16 +868,6 @@ Layout::get_output_section(const char* name, Stringpool::Key name_key,
 		  && (same_name->flags() & elfcpp::SHF_TLS) == 0)
 		os = same_name;
 	    }
-	  else if ((flags & elfcpp::SHF_TLS) == 0)
-	    {
-	      elfcpp::Elf_Xword zero_flags = 0;
-	      const Key zero_key(name_key, std::make_pair(lookup_type,
-							  zero_flags));
-	      Section_name_map::iterator p =
-		  this->section_name_map_.find(zero_key);
-	      if (p != this->section_name_map_.end())
-		os = p->second;
-	    }
 	}
 
       if (os == NULL)
-- 
2.20.1



More information about the Binutils mailing list