Revert "Fix race condition while building EH frame header."
authorCary Coutant <ccoutant@google.com>
Thu, 14 Nov 2013 21:15:06 +0000 (13:15 -0800)
committerCary Coutant <ccoutant@google.com>
Thu, 14 Nov 2013 21:15:55 +0000 (13:15 -0800)
This reverts commit 7cdd7d57e6fa3932eb63aa785ae0e3fa837aab20.

gold/ChangeLog
gold/ehframe.cc
gold/ehframe.h

index a56044cac2d8f15915b879a4bc1d3ac800254d29..d953d70cbd0b10453a912d07f30831b302f6c06c 100644 (file)
@@ -1,3 +1,17 @@
+2013-11-14  Cary Coutant  <ccoutant@google.com>
+
+       Revert patch -- this did not fix the problem, and there is
+       no race there.
+
+       2013-11-14  Cary Coutant  <ccoutant@google.com>
+
+           PR gold/14860
+           * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
+           (Ehframe_hdr::set_final_data_size): Allocate a Lock.
+           * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
+           updating fde_offsets_.
+           (Eh_frame_hdr::lock_): New data member.
+
 2013-11-14  Cary Coutant  <ccoutant@google.com>
 
        * dwp.cc (Dwo_file_entry): New type.
index be262bffad358f9d07cd2edc08e58d4b50e3f55d..08a9ec6bd17559b0c76b39e85939f2cd5a067453 100644 (file)
@@ -84,8 +84,7 @@ Eh_frame_hdr::Eh_frame_hdr(Output_section* eh_frame_section,
     eh_frame_section_(eh_frame_section),
     eh_frame_data_(eh_frame_data),
     fde_offsets_(),
-    any_unrecognized_eh_frame_sections_(false),
-    lock_(NULL)
+    any_unrecognized_eh_frame_sections_(false)
 {
 }
 
@@ -103,9 +102,6 @@ Eh_frame_hdr::set_final_data_size()
       this->fde_offsets_.reserve(fde_count);
     }
   this->set_data_size(data_size);
-  // We need a lock for updating the fde_offsets_ vector while writing
-  // the FDEs.
-  this->lock_ = new Lock();
 }
 
 // Write the data to the file.
index d5ac668e417faf423b8feddca5d3cf33705119b5..8aab8b81684b58317dc11f21c25b9fe6c52ad4ba 100644 (file)
@@ -60,10 +60,7 @@ class Eh_frame_hdr : public Output_section_data
   record_fde(section_offset_type fde_offset, unsigned char fde_encoding)
   {
     if (!this->any_unrecognized_eh_frame_sections_)
-      {
-       Hold_lock(*this->lock_);
-       this->fde_offsets_.push_back(std::make_pair(fde_offset, fde_encoding));
-      }
+      this->fde_offsets_.push_back(std::make_pair(fde_offset, fde_encoding));
   }
 
  protected:
@@ -160,8 +157,6 @@ class Eh_frame_hdr : public Output_section_data
   // Whether we found any .eh_frame sections which we could not
   // process.
   bool any_unrecognized_eh_frame_sections_;
-  // Lock held while updating fde_offsets_.
-  Lock* lock_;
 };
 
 // This class holds an FDE.