* options.cc: Include "demangle.h".
[deliverable/binutils-gdb.git] / gold / ehframe.cc
index df9448897fe9289eb76e6db825ba30e1b3bc91f4..4ec29f6b97f7694b7762dbe7198ad7d6e33bdd07 100644 (file)
@@ -1,6 +1,6 @@
 // ehframe.cc -- handle exception frame sections for gold
 
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -487,7 +487,9 @@ Eh_frame::Eh_frame()
     eh_frame_hdr_(NULL),
     cie_offsets_(),
     unmergeable_cie_offsets_(),
-    merge_map_()
+    merge_map_(),
+    mappings_are_done_(false),
+    final_data_size_(0)
 {
 }
 
@@ -1011,6 +1013,15 @@ Eh_frame::fde_count() const
 void
 Eh_frame::set_final_data_size()
 {
+  // We can be called more than once if Layout::set_segment_offsets
+  // finds a better mapping.  We don't want to add all the mappings
+  // again.
+  if (this->mappings_are_done_)
+    {
+      this->set_data_size(this->final_data_size_);
+      return;
+    }
+
   section_offset_type output_offset = 0;
 
   for (Unmergeable_cie_offsets::iterator p =
@@ -1028,6 +1039,9 @@ Eh_frame::set_final_data_size()
                                            this->addralign(),
                                            &this->merge_map_);
 
+  this->mappings_are_done_ = true;
+  this->final_data_size_ = output_offset;
+
   gold_assert((output_offset & (this->addralign() - 1)) == 0);
   this->set_data_size(output_offset);
 }
This page took 0.025269 seconds and 4 git commands to generate.