include/opcode/
[deliverable/binutils-gdb.git] / gold / layout.cc
index afb5b6af041bce085dc8a0e53b24f00e10a62050..a4ef31ac5c249db077728f9720562f9c515949d1 100644 (file)
@@ -410,6 +410,7 @@ Layout::Layout(int number_of_input_files, Script_options* script_options)
     script_output_section_data_list_(),
     segment_states_(NULL),
     relaxation_debug_check_(NULL),
+    section_order_map_(),
     input_section_position_(),
     input_section_glob_(),
     incremental_base_(NULL),
@@ -898,11 +899,10 @@ Layout::init_fixed_output_section(const char* name,
 {
   unsigned int sh_type = shdr.get_sh_type();
 
-  // We preserve the layout of PROGBITS, NOBITS, and NOTE sections.
+  // We preserve the layout of PROGBITS, NOBITS, INIT_ARRAY, FINI_ARRAY,
+  // PRE_INIT_ARRAY, and NOTE sections.
   // All others will be created from scratch and reallocated.
-  if (sh_type != elfcpp::SHT_PROGBITS
-      && sh_type != elfcpp::SHT_NOBITS
-      && sh_type != elfcpp::SHT_NOTE)
+  if (!can_incremental_update(sh_type))
     return NULL;
 
   typename elfcpp::Elf_types<size>::Elf_Addr sh_addr = shdr.get_sh_addr();
@@ -1442,6 +1442,7 @@ Layout::make_output_section(const char* name, elfcpp::Elf_Word type,
       && order != ORDER_FINI
       && order != ORDER_RELRO_LAST
       && order != ORDER_NON_RELRO_FIRST
+      && strcmp(name, ".eh_frame") != 0
       && strcmp(name, ".ctors") != 0
       && strcmp(name, ".dtors") != 0
       && strcmp(name, ".jcr") != 0)
@@ -2975,8 +2976,9 @@ Layout::segment_precedes(const Output_segment* seg1,
 
   // We shouldn't get here--we shouldn't create segments which we
   // can't distinguish.  Unless of course we are using a weird linker
-  // script.
-  gold_assert(this->script_options_->saw_phdrs_clause());
+  // script or overlapping --section-start options.
+  gold_assert(this->script_options_->saw_phdrs_clause()
+             || parameters->options().any_section_start());
   return false;
 }
 
This page took 0.024288 seconds and 4 git commands to generate.