bfd/
[deliverable/binutils-gdb.git] / gold / object.h
index cd2bc8d8e483bb930854aa4d8a6587ef3843b643..2df04abad85b64d28a357735a969e18efefbea3e 100644 (file)
@@ -140,22 +140,10 @@ class Object
   Sized_target<size, big_endian>*
   sized_target(ACCEPT_SIZE_ENDIAN_ONLY);
 
-  // Read the symbol information.
-  void
-  read_symbols(Read_symbols_data* sd)
-  { return this->do_read_symbols(sd); }
-
-  // Pass sections which should be included in the link to the Layout
-  // object, and record where the sections go in the output file.
-  void
-  layout(const General_options& options, Symbol_table* symtab,
-        Layout* layout, Read_symbols_data* sd)
-  { this->do_layout(options, symtab, layout, sd); }
-
-  // Add symbol information to the global symbol table.
-  void
-  add_symbols(Symbol_table* symtab, Read_symbols_data* sd)
-  { this->do_add_symbols(symtab, sd); }
+  // Get the number of sections.
+  unsigned int
+  shnum() const
+  { return this->shnum_; }
 
   // Return a view of the contents of a section.  Set *PLEN to the
   // size.
@@ -173,6 +161,23 @@ class Object
   section_flags(unsigned int shndx)
   { return this->do_section_flags(shndx); }
 
+  // Read the symbol information.
+  void
+  read_symbols(Read_symbols_data* sd)
+  { return this->do_read_symbols(sd); }
+
+  // Pass sections which should be included in the link to the Layout
+  // object, and record where the sections go in the output file.
+  void
+  layout(const General_options& options, Symbol_table* symtab,
+        Layout* layout, Read_symbols_data* sd)
+  { this->do_layout(options, symtab, layout, sd); }
+
+  // Add symbol information to the global symbol table.
+  void
+  add_symbols(Symbol_table* symtab, Read_symbols_data* sd)
+  { this->do_add_symbols(symtab, sd); }
+
   // Functions and types for the elfcpp::Elf_file interface.  This
   // permit us to use Object as the File template parameter for
   // elfcpp::Elf_file.
@@ -280,11 +285,6 @@ class Object
   set_target(int machine, int size, bool big_endian, int osabi,
             int abiversion);
 
-  // Get the number of sections.
-  unsigned int
-  shnum() const
-  { return this->shnum_; }
-
   // Set the number of sections.
   void
   set_shnum(int shnum)
@@ -373,17 +373,17 @@ class Relobj : public Object
 
   // Return whether an input section is being included in the link.
   bool
-  is_section_included(unsigned int shnum) const
+  is_section_included(unsigned int shndx) const
   {
-    gold_assert(shnum < this->map_to_output_.size());
-    return this->map_to_output_[shnum].output_section != NULL;
+    gold_assert(shndx < this->map_to_output_.size());
+    return this->map_to_output_[shndx].output_section != NULL;
   }
 
   // Given a section index, return the corresponding Output_section
   // (which will be NULL if the section is not included in the link)
   // and set *POFF to the offset within that section.
   inline Output_section*
-  output_section(unsigned int shnum, off_t* poff);
+  output_section(unsigned int shndx, off_t* poff);
 
   // Set the offset of an input section within its output section.
   void
@@ -437,10 +437,10 @@ class Relobj : public Object
 
 // Implement Object::output_section inline for efficiency.
 inline Output_section*
-Relobj::output_section(unsigned int shnum, off_t* poff)
+Relobj::output_section(unsigned int shndx, off_t* poff)
 {
-  gold_assert(shnum < this->map_to_output_.size());
-  const Map_to_output& mo(this->map_to_output_[shnum]);
+  gold_assert(shndx < this->map_to_output_.size());
+  const Map_to_output& mo(this->map_to_output_[shndx]);
   *poff = mo.offset;
   return mo.output_section;
 }
@@ -600,7 +600,7 @@ class Input_objects
 {
  public:
   Input_objects()
-    : relobj_list_(), target_(NULL)
+    : relobj_list_(), dynobj_list_(), target_(NULL), sonames_()
   { }
 
   // The type of the list of input relocateable objects.
@@ -611,8 +611,9 @@ class Input_objects
   typedef std::vector<Dynobj*> Dynobj_list;
   typedef Dynobj_list::const_iterator Dynobj_iterator;
 
-  // Add an object to the list.
-  void
+  // Add an object to the list.  Return true if all is well, or false
+  // if this object should be ignored.
+  bool
   add_object(Object*);
 
   // Get the target we should use for the output file.
@@ -649,9 +650,14 @@ class Input_objects
   Input_objects(const Input_objects&);
   Input_objects& operator=(const Input_objects&);
 
+  // The list of ordinary objects included in the link.
   Relobj_list relobj_list_;
+  // The list of dynamic objects included in the link.
   Dynobj_list dynobj_list_;
+  // The target.
   Target* target_;
+  // SONAMEs that we have seen.
+  Unordered_set<std::string> sonames_;
 };
 
 // Some of the information we pass to the relocation routines.  We
This page took 0.025398 seconds and 4 git commands to generate.