gas/
[deliverable/binutils-gdb.git] / gold / layout.h
index 4c54e005554eac3de42e882c3ca485f77635c764..3e09d62ca30b1e4db2d1901284a1d1b9787abb28 100644 (file)
@@ -1,5 +1,25 @@
 // layout.h -- lay out output file sections for gold  -*- C++ -*-
 
+// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Written by Ian Lance Taylor <iant@google.com>.
+
+// This file is part of gold.
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+// MA 02110-1301, USA.
+
 #ifndef GOLD_LAYOUT_H
 #define GOLD_LAYOUT_H
 
@@ -10,6 +30,7 @@
 
 #include "workqueue.h"
 #include "object.h"
+#include "dynobj.h"
 #include "stringpool.h"
 
 namespace gold
@@ -84,6 +105,10 @@ class Layout
   void
   create_initial_dynamic_sections(const Input_objects*, Symbol_table*);
 
+  // Define __start and __stop symbols for output sections.
+  void
+  define_section_symbols(Symbol_table*, const Target*);
+
   // Return the Stringpool used for symbol names.
   const Stringpool*
   sympool() const
@@ -142,7 +167,7 @@ class Layout
   // Write out data not associated with an input file or the symbol
   // table.
   void
-  write_data(const Symbol_table*, const Target*, Output_file*) const;
+  write_data(const Symbol_table*, Output_file*) const;
 
   // Return an output section named NAME, or NULL if there is none.
   Output_section*
@@ -181,6 +206,13 @@ class Layout
   static const Linkonce_mapping linkonce_mapping[];
   static const int linkonce_mapping_count;
 
+  // Handle an exception frame section.
+  template<int size, bool big_endian>
+  void
+  layout_eh_frame(Relobj*, unsigned int, const char*,
+                 const elfcpp::Shdr<size, big_endian>&,
+                 Output_section*, off_t*);
+
   // Find the first read-only PT_LOAD segment, creating one if
   // necessary.
   Output_segment*
@@ -188,8 +220,7 @@ class Layout
 
   // Create the output sections for the symbol table.
   void
-  create_symtab_sections(int size, const Input_objects*, Symbol_table*,
-                        off_t*);
+  create_symtab_sections(const Input_objects*, Symbol_table*, off_t*);
 
   // Create the .shstrtab section.
   Output_section*
@@ -197,11 +228,14 @@ class Layout
 
   // Create the section header table.
   Output_section_headers*
-  create_shdrs(int size, bool big_endian, off_t*);
+  create_shdrs(off_t*);
 
   // Create the dynamic symbol table.
   void
-  create_dynamic_symtab(const Target*, Symbol_table*);
+  create_dynamic_symtab(const Target*, Symbol_table*, Output_section** pdynstr,
+                       unsigned int* plocal_dynamic_count,
+                       std::vector<Symbol*>* pdynamic_symbols,
+                       Versions* versions);
 
   // Finish the .dynamic section and PT_DYNAMIC segment.
   void
@@ -211,6 +245,21 @@ class Layout
   void
   create_interp(const Target* target);
 
+  // Create the version sections.
+  void
+  create_version_sections(const Versions*,
+                         unsigned int local_symcount,
+                         const std::vector<Symbol*>& dynamic_symbols,
+                         const Output_section* dynstr);
+
+  template<int size, bool big_endian>
+  void
+  sized_create_version_sections(const Versions* versions,
+                               unsigned int local_symcount,
+                               const std::vector<Symbol*>& dynamic_symbols,
+                               const Output_section* dynstr
+                                ACCEPT_SIZE_ENDIAN);
+
   // Return whether to include this section in the link.
   template<int size, bool big_endian>
   bool
@@ -242,7 +291,7 @@ class Layout
   off_t
   set_segment_offsets(const Target*, Output_segment*, unsigned int* pshndx);
 
-  // Set the final file offsets and section indices of all the
+  // Set the final file offsets and section indexes of all the
   // sections not associated with a segment.
   off_t
   set_section_offsets(off_t, unsigned int *pshndx);
@@ -313,6 +362,8 @@ class Layout
   Output_section* dynamic_section_;
   // The dynamic data which goes into dynamic_section_.
   Output_data_dynamic* dynamic_data_;
+  // The exception frame section.
+  Output_section* eh_frame_section_;
 };
 
 // This task handles writing out data which is not part of a section
@@ -322,10 +373,8 @@ class Write_data_task : public Task
 {
  public:
   Write_data_task(const Layout* layout, const Symbol_table* symtab,
-                 const Target* target, Output_file* of,
-                 Task_token* final_blocker)
-    : layout_(layout), symtab_(symtab), target_(target), of_(of),
-      final_blocker_(final_blocker)
+                 Output_file* of, Task_token* final_blocker)
+    : layout_(layout), symtab_(symtab), of_(of), final_blocker_(final_blocker)
   { }
 
   // The standard Task methods.
@@ -342,7 +391,6 @@ class Write_data_task : public Task
  private:
   const Layout* layout_;
   const Symbol_table* symtab_;
-  const Target* target_;
   Output_file* of_;
   Task_token* final_blocker_;
 };
This page took 0.024753 seconds and 4 git commands to generate.