* gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
[deliverable/binutils-gdb.git] / gold / layout.h
index f2c170b988aad5906587d6907648aadb42e44a7b..05cb50fa6a4185f9b558d6cbcd9b99e5da9aae52 100644 (file)
@@ -71,34 +71,60 @@ is_compressed_debug_section(const char* secname);
 class Free_list
 {
  public:
+  struct Free_list_node
+  {
+    Free_list_node(off_t start, off_t end)
+      : start_(start), end_(end)
+    { }
+    off_t start_;
+    off_t end_;
+  };
+  typedef std::list<Free_list_node>::const_iterator Const_iterator;
+
   Free_list()
-    : list_(), last_remove_(list_.begin()), extend_(false), length_(0)
+    : list_(), last_remove_(list_.begin()), extend_(false), length_(0),
+      min_hole_(0)
   { }
 
+  // Initialize the free list for a section of length LEN.
+  // If EXTEND is true, free space may be allocated past the end.
   void
   init(off_t len, bool extend);
 
+  // Set the minimum hole size that is allowed when allocating
+  // from the free list.
+  void
+  set_min_hole_size(off_t min_hole)
+  { this->min_hole_ = min_hole; }
+
+  // Remove a chunk from the free list.
   void
   remove(off_t start, off_t end);
 
+  // Allocate a chunk of space from the free list of length LEN,
+  // with alignment ALIGN, and minimum offset MINOFF.
   off_t
   allocate(off_t len, uint64_t align, off_t minoff);
 
+  // Return an iterator for the beginning of the free list.
+  Const_iterator
+  begin() const
+  { return this->list_.begin(); }
+
+  // Return an iterator for the end of the free list.
+  Const_iterator
+  end() const
+  { return this->list_.end(); }
+
+  // Dump the free list (for debugging).
   void
   dump();
 
+  // Print usage statistics.
   static void
   print_stats();
 
  private:
-  struct Free_list_node
-  {
-    Free_list_node(off_t start, off_t end)
-      : start_(start), end_(end)
-    { }
-    off_t start_;
-    off_t end_;
-  };
   typedef std::list<Free_list_node>::iterator Iterator;
 
   // The free list.
@@ -113,6 +139,10 @@ class Free_list
   // The total length of the section, segment, or file.
   off_t length_;
 
+  // The minimum hole size allowed.  When allocating from the free list,
+  // we must not leave a hole smaller than this.
+  off_t min_hole_;
+
   // Statistics:
   // The total number of free lists used.
   static unsigned int num_lists;
@@ -627,6 +657,12 @@ class Layout
   dynpool() const
   { return &this->dynpool_; }
 
+  // Return the .dynamic output section.  This is only valid after the
+  // layout has been finalized.
+  Output_section*
+  dynamic_section() const
+  { return this->dynamic_section_; }
+
   // Return the symtab_xindex section used to hold large section
   // indexes for the normal symbol table.
   Output_symtab_xindex*
This page took 0.025401 seconds and 4 git commands to generate.