This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH COMMITTED: Remove Output_segment::add_initial_output_section


I have no recollection of why I added the add_initial_output_section
function in Output_segment.  It seems clearly unneeded today, as it is
only called on a newly created Output_segment.  I committed this patch
to clean up the code.

Ian


2008-05-16  Ian Lance Taylor  <iant@google.com>

	* output.cc (Output_segment::add_output_section): Remove front
	parameter.
	* output.h (class Output_segment): Remove
	add_initial_output_section and overloaded add_output_section.
	Update declaration of remaining add_output_section.
	* layout.cc (Layout::create_interp): Call add_output_section
	rather than add_initial_output_section.
	(Layout::finish_dynamic_section): Likewise.


Index: layout.cc
===================================================================
RCS file: /cvs/src/src/gold/layout.cc,v
retrieving revision 1.102
diff -p -u -r1.102 layout.cc
--- layout.cc	5 May 2008 19:16:43 -0000	1.102
+++ layout.cc	16 May 2008 22:27:18 -0000
@@ -2479,7 +2479,7 @@ Layout::create_interp(const Target* targ
     {
       Output_segment* oseg = this->make_output_segment(elfcpp::PT_INTERP,
 						       elfcpp::PF_R);
-      oseg->add_initial_output_section(osec, elfcpp::PF_R);
+      oseg->add_output_section(osec, elfcpp::PF_R);
     }
 }
 
@@ -2494,8 +2494,8 @@ Layout::finish_dynamic_section(const Inp
       Output_segment* oseg = this->make_output_segment(elfcpp::PT_DYNAMIC,
 						       (elfcpp::PF_R
 							| elfcpp::PF_W));
-      oseg->add_initial_output_section(this->dynamic_section_,
-				       elfcpp::PF_R | elfcpp::PF_W);
+      oseg->add_output_section(this->dynamic_section_,
+			       elfcpp::PF_R | elfcpp::PF_W);
     }
 
   Output_data_dynamic* const odyn = this->dynamic_data_;
Index: output.cc
===================================================================
RCS file: /cvs/src/src/gold/output.cc,v
retrieving revision 1.76
diff -p -u -r1.76 output.cc
--- output.cc	16 May 2008 15:27:49 -0000	1.76
+++ output.cc	16 May 2008 22:27:18 -0000
@@ -2579,8 +2579,7 @@ Output_segment::Output_segment(elfcpp::E
 
 void
 Output_segment::add_output_section(Output_section* os,
-				   elfcpp::Elf_Word seg_flags,
-				   bool front)
+				   elfcpp::Elf_Word seg_flags)
 {
   gold_assert((os->flags() & elfcpp::SHF_ALLOC) != 0);
   gold_assert(!this->is_max_align_known_);
@@ -2615,7 +2614,6 @@ Output_segment::add_output_section(Outpu
 	  --p;
 	  if ((*p)->is_section_type(elfcpp::SHT_NOTE))
 	    {
-	      // We don't worry about the FRONT parameter.
 	      ++p;
 	      pdl->insert(p, os);
 	      return;
@@ -2660,7 +2658,6 @@ Output_segment::add_output_section(Outpu
 
 	  if (insert)
 	    {
-	      // We don't worry about the FRONT parameter.
 	      ++p;
 	      pdl->insert(p, os);
 	      return;
@@ -2672,10 +2669,7 @@ Output_segment::add_output_section(Outpu
       // location in the section list.
     }
 
-  if (front)
-    pdl->push_front(os);
-  else
-    pdl->push_back(os);
+  pdl->push_back(os);
 }
 
 // Remove an Output_section from this segment.  It is an error if it
Index: output.h
===================================================================
RCS file: /cvs/src/src/gold/output.h,v
retrieving revision 1.69
diff -p -u -r1.69 output.h
--- output.h	16 May 2008 15:27:49 -0000	1.69
+++ output.h	16 May 2008 22:27:18 -0000
@@ -2682,13 +2682,7 @@ class Output_segment
 
   // Add an Output_section to this segment.
   void
-  add_output_section(Output_section* os, elfcpp::Elf_Word seg_flags)
-  { this->add_output_section(os, seg_flags, false); }
-
-  // Add an Output_section to the start of this segment.
-  void
-  add_initial_output_section(Output_section* os, elfcpp::Elf_Word seg_flags)
-  { this->add_output_section(os, seg_flags, true); }
+  add_output_section(Output_section* os, elfcpp::Elf_Word seg_flags);
 
   // Remove an Output_section from this segment.  It is an error if it
   // is not present.
@@ -2787,11 +2781,6 @@ class Output_segment
 
   typedef std::list<Output_data*> Output_data_list;
 
-  // Add an Output_section to this segment, specifying front or back.
-  void
-  add_output_section(Output_section*, elfcpp::Elf_Word seg_flags,
-		     bool front);
-
   // Find the maximum alignment in an Output_data_list.
   static uint64_t
   maximum_alignment_list(const Output_data_list*);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]