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]

gold patch committed: Don't do shstrtab after other sections


I noticed that the .shstrtab section is marked to be done after all
input sections are complete.  That is only necessary if some section
names can change, and that only happens if we are compressing debug
sections.  I suspect that we can avoid it even in that case, but in
case this is a conservative change which should make the linker
infinitesimally faster.  Committed to mainline.

Ian


2009-12-15  Ian Lance Taylor  <iant@google.com>

	* layout.cc (Layout::create_shstrtab): Only write out after input
	sections if we are compressing debug sections.


Index: layout.cc
===================================================================
RCS file: /cvs/src/src/gold/layout.cc,v
retrieving revision 1.148
diff -p -u -r1.148 layout.cc
--- layout.cc	14 Dec 2009 19:53:04 -0000	1.148
+++ layout.cc	15 Dec 2009 22:19:21 -0000
@@ -2694,10 +2694,14 @@ Layout::create_shstrtab()
   Output_section* os = this->make_output_section(name, elfcpp::SHT_STRTAB, 0,
 						 false, false);
 
-  // We can't write out this section until we've set all the section
-  // names, and we don't set the names of compressed output sections
-  // until relocations are complete.
-  os->set_after_input_sections();
+  if (strcmp(parameters->options().compress_debug_sections(), "none") != 0)
+    {
+      // We can't write out this section until we've set all the
+      // section names, and we don't set the names of compressed
+      // output sections until relocations are complete.  FIXME: With
+      // the current names we use, this is unnecessary.
+      os->set_after_input_sections();
+    }
 
   Output_section_data* posd = new Output_data_strtab(&this->namepool_);
   os->add_output_section_data(posd);

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