* dwarf2loc.c (dwarf_expr_frame_base): Error out on missing
[deliverable/binutils-gdb.git] / gold / ehframe.h
index ce4f6df5879ee5714b3d25f21f82bd4d963f9544..47e3e4c00cabbc78a08e89bac6e3d82b050ffb7a 100644 (file)
@@ -1,6 +1,6 @@
 // ehframe.h -- handle exception frame sections for gold  -*- C++ -*-
 
-// 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.
 #ifndef GOLD_EHFRAME_H
 #define GOLD_EHFRAME_H
 
+#include <map>
+#include <set>
+#include <vector>
+
 #include "output.h"
 #include "merge.h"
 
@@ -180,13 +184,14 @@ class Fde
   }
 
   // Write the FDE to OVIEW starting at OFFSET.  FDE_ENCODING is the
-  // encoding, from the CIE.  Record the FDE in EH_FRAME_HDR.  Return
-  // the new offset.
+  // encoding, from the CIE.  Round up the bytes to ADDRALIGN if
+  // necessary.  Record the FDE in EH_FRAME_HDR.  Return the new
+  // offset.
   template<int size, bool big_endian>
   section_offset_type
   write(unsigned char* oview, section_offset_type offset,
-       section_offset_type cie_offset, unsigned char fde_encoding,
-       Eh_frame_hdr* eh_frame_hdr);
+       unsigned int addralign, section_offset_type cie_offset,
+        unsigned char fde_encoding, Eh_frame_hdr* eh_frame_hdr);
 
  private:
   // The object in which this FDE was seen.
@@ -249,11 +254,12 @@ class Cie
                    Merge_map*);
 
   // Write the CIE to OVIEW starting at OFFSET.  EH_FRAME_HDR is the
-  // exception frame header for FDE recording.  Return the new offset.
+  // exception frame header for FDE recording.  Round up the bytes to
+  // ADDRALIGN.  Return the new offset.
   template<int size, bool big_endian>
   section_offset_type
   write(unsigned char* oview, section_offset_type offset,
-       Eh_frame_hdr* eh_frame_hdr);
+       unsigned int addralign, Eh_frame_hdr* eh_frame_hdr);
 
   friend bool operator<(const Cie&, const Cie&);
   friend bool operator==(const Cie&, const Cie&);
@@ -326,6 +332,10 @@ class Eh_frame : public Output_section_data
                   section_offset_type offset,
                   section_offset_type* poutput) const;
 
+  // Return whether this is the merge section for an input section.
+  bool
+  do_is_merge_section_for(const Relobj*, unsigned int shndx) const;
+
   // Write the data to the file.
   void
   do_write(Output_file*);
@@ -339,11 +349,11 @@ class Eh_frame : public Output_section_data
     { return *cie1 < *cie2; }
   };
 
-  // A mapping from unique CIEs to their offset in the output file.
-  typedef std::map<Cie*, uint64_t, Cie_less> Cie_offsets;
+  // A set of unique CIEs.
+  typedef std::set<Cie*, Cie_less> Cie_offsets;
 
-  // A list of unmergeable CIEs with their offsets.
-  typedef std::vector<std::pair<Cie*, uint64_t> > Unmergeable_cie_offsets;
+  // A list of unmergeable CIEs.
+  typedef std::vector<Cie*> Unmergeable_cie_offsets;
 
   // A mapping from offsets to CIEs.  This is used while reading an
   // input section.
@@ -417,6 +427,11 @@ class Eh_frame : public Output_section_data
   Unmergeable_cie_offsets unmergeable_cie_offsets_;
   // A mapping from input sections to the output section.
   Merge_map merge_map_;
+  // Whether we have created the mappings to the output section.
+  bool mappings_are_done_;
+  // The final data size.  This is only set if mappings_are_done_ is
+  // true.
+  section_size_type final_data_size_;
 };
 
 } // End namespace gold.
This page took 0.030901 seconds and 4 git commands to generate.