* arm.cc (Target_arm::do_finalize_sections): Create attribute
authorIan Lance Taylor <ian@airs.com>
Tue, 23 Feb 2010 17:45:38 +0000 (17:45 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 23 Feb 2010 17:45:38 +0000 (17:45 +0000)
section if it does not already exist.
* attributes.cc (Attributes_section_data::Attributes_section_data):
Don't crash if size is zero.

gold/ChangeLog
gold/arm.cc
gold/attributes.cc

index 45017f229bc1eefc78d3d8a1cc4042cc90922205..6259834dd94badc5537f1ea287bfd49adf98e251 100644 (file)
@@ -1,3 +1,10 @@
+2010-02-23  Viktor Kutuzov  <vkutuzov@accesssoftek.com>
+
+       * arm.cc (Target_arm::do_finalize_sections): Create attribute
+       section if it does not already exist.
+       * attributes.cc (Attributes_section_data::Attributes_section_data):
+       Don't crash if size is zero.
+
 2010-02-23  Viktor Kutuzov  <vkutuzov@accesssoftek.com>
            Ian Lance Taylor  <iant@google.com>
 
index bc5557a7e4408650cb632ed8ca8916eb81e5c86e..b8141e0a7c10eddb6f459f3a4e835ed1846b4443 100644 (file)
@@ -7554,6 +7554,11 @@ Target_arm<big_endian>::do_finalize_sections(
     const Input_objects* input_objects,
     Symbol_table* symtab)
 {
+  // Create an empty uninitialized attribute section if we still don't have it
+  // at this moment.
+  if (this->attributes_section_data_ == NULL)
+    this->attributes_section_data_ = new Attributes_section_data(NULL, 0);
+
   // Merge processor-specific flags.
   for (Input_objects::Relobj_iterator p = input_objects->relobj_begin();
        p != input_objects->relobj_end();
index 2024fda62966168e744d164ac1672e482c3f7cf0..b9b36089e3653ba9cf3c8d7b6c7e2f8095dae606 100644 (file)
@@ -278,7 +278,7 @@ Attributes_section_data::Attributes_section_data(
 
   const unsigned char *p = view;
   p = view;
-  if (*(p++) == 'A')
+  if (size > 0 && p != NULL && *(p++) == 'A')
     {
       size--;
       while (size > 0)
This page took 0.035421 seconds and 4 git commands to generate.