2010-06-16 Doug Kwan <dougkwan@google.com>
authorDoug Kwan <dougkwan@google.com>
Wed, 16 Jun 2010 18:19:18 +0000 (18:19 +0000)
committerDoug Kwan <dougkwan@google.com>
Wed, 16 Jun 2010 18:19:18 +0000 (18:19 +0000)
* arm.cc (Target_arm::do_finalize_sections): Do not emit an
.ARM.attributes section if we have not merged any input
attributes sections.

gold/ChangeLog
gold/arm.cc

index f5e960ab6ebf267f5c0e88ba2d751de7901443ae..afb87530f438832a81994956af01a8cddc9ef22d 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-16  Doug Kwan  <dougkwan@google.com>
+
+       * arm.cc (Target_arm::do_finalize_sections): Do not emit an
+       .ARM.attributes section if we have not merged any input
+       attributes sections.
+
 2010-06-15  Viktor Kutuzov  <vkutuzov@accesssoftek.com>
 
        * arm.cc: Allow combining objects with no EABI version
index ff07a90854533392d47e90a59aa054b000244d47..d9aa76795f920ba80e9c4c107fd40641aa17a7fd 100644 (file)
@@ -8101,6 +8101,7 @@ Target_arm<big_endian>::do_finalize_sections(
     const Input_objects* input_objects,
     Symbol_table* symtab)
 {
+  bool merged_any_attributes = false;
   // Merge processor-specific flags.
   for (Input_objects::Relobj_iterator p = input_objects->relobj_begin();
        p != input_objects->relobj_end();
@@ -8115,6 +8116,7 @@ Target_arm<big_endian>::do_finalize_sections(
              arm_relobj->processor_specific_flags());
          this->merge_object_attributes(arm_relobj->name().c_str(),
                                        arm_relobj->attributes_section_data());
+         merged_any_attributes = true;
        }
     } 
 
@@ -8129,6 +8131,7 @@ Target_arm<big_endian>::do_finalize_sections(
          arm_dynobj->processor_specific_flags());
       this->merge_object_attributes(arm_dynobj->name().c_str(),
                                    arm_dynobj->attributes_section_data());
+      merged_any_attributes = true;
     }
 
   // Create an empty uninitialized attribute section if we still don't have it
@@ -8210,9 +8213,9 @@ Target_arm<big_endian>::do_finalize_sections(
        }
     }
 
-  // Create an .ARM.attributes section unless we have no regular input
-  // object.  In that case the output will be empty.
-  if (input_objects->number_of_relobjs() != 0)
+  // Create an .ARM.attributes section if we have merged any attributes
+  // from inputs.
+  if (merged_any_attributes)
     {
       Output_attributes_section_data* attributes_section =
       new Output_attributes_section_data(*this->attributes_section_data_);
This page took 0.034948 seconds and 4 git commands to generate.