Linux process record and replay support.
[deliverable/binutils-gdb.git] / gold / object.h
index 9e4c66f27cca92f4eb080aee5e41869f79c5793e..97c126d52b1ffc2aa0e4a9b2dfc761ff523b1e1e 100644 (file)
@@ -227,6 +227,15 @@ class Object
   target() const
   { return this->target_; }
 
+  // Get the file.  We pass on const-ness.
+  Input_file*
+  input_file()
+  { return this->input_file_; }
+
+  const Input_file*
+  input_file() const
+  { return this->input_file_; }
+
   // Lock the underlying file.
   void
   lock(const Task* t)
@@ -449,6 +458,11 @@ class Object
   is_in_system_directory() const
   { return this->input_file()->is_in_system_directory(); }
 
+  // Return whether we found this object by searching a directory.
+  bool
+  searched_for() const
+  { return this->input_file()->will_search_for(); }
+
  protected:
   // Returns NULL for Objects that are not plugin objects.  This method
   // is overridden in the Pluginobj class.
@@ -514,15 +528,6 @@ class Object
   virtual void
   do_get_global_symbol_counts(const Symbol_table*, size_t*, size_t*) const = 0;
 
-  // Get the file.  We pass on const-ness.
-  Input_file*
-  input_file()
-  { return this->input_file_; }
-
-  const Input_file*
-  input_file() const
-  { return this->input_file_; }
-
   // Set the target.
   void
   set_target(int machine, int size, bool big_endian, int osabi,
@@ -1584,32 +1589,6 @@ class Sized_relobj : public Relobj
   typedef std::map<unsigned int, Kept_comdat_section*>
       Kept_comdat_section_table;
 
-  // Information needed to keep track of kept comdat groups.  This is
-  // simply a map from the section name to its section index.  This may
-  // not be a one-to-one mapping, but we ignore that possibility since
-  // this is used only to attempt to handle stray relocations from
-  // non-comdat debug sections that refer to comdat loadable sections.
-  typedef Unordered_map<std::string, unsigned int> Comdat_group;
-
-  // A map from group section index to the table of group members.
-  typedef std::map<unsigned int, Comdat_group*> Comdat_group_table;
-
-  // Find a comdat group table given its group section SHNDX.
-  Comdat_group*
-  find_comdat_group(unsigned int shndx) const
-  {
-    Comdat_group_table::const_iterator p =
-      this->comdat_groups_.find(shndx);
-    if (p != this->comdat_groups_.end())
-      return p->second;
-    return NULL;
-  }
-
-  // Record a new comdat group whose group section index is SHNDX.
-  void
-  add_comdat_group(unsigned int shndx, Comdat_group* group)
-  { this->comdat_groups_[shndx] = group; }
-
   // Adjust a section index if necessary.
   unsigned int
   adjust_shndx(unsigned int shndx)
@@ -1823,8 +1802,6 @@ class Sized_relobj : public Relobj
   std::vector<Address> section_offsets_;
   // Table mapping discarded comdat sections to corresponding kept sections.
   Kept_comdat_section_table kept_comdat_sections_;
-  // Table of kept comdat groups.
-  Comdat_group_table comdat_groups_;
   // Whether this object has a GNU style .eh_frame section.
   bool has_eh_frame_;
   // The list of sections whose layout was deferred.
@@ -1944,13 +1921,24 @@ struct Relocate_info
   location(size_t relnum, off_t reloffset) const;
 };
 
+// Return whether INPUT_FILE contains an ELF object start at file
+// offset OFFSET.  This sets *START to point to a view of the start of
+// the file.  It sets *READ_SIZE to the number of bytes in the view.
+
+extern bool
+is_elf_object(Input_file* input_file, off_t offset,
+             const unsigned char** start, int *read_size);
+
 // Return an Object appropriate for the input file.  P is BYTES long,
-// and holds the ELF header.
+// and holds the ELF header.  If PUNCONFIGURED is not NULL, then if
+// this sees an object the linker is not configured to support, it
+// sets *PUNCONFIGURED to true and returns NULL without giving an
+// error message.
 
 extern Object*
 make_elf_object(const std::string& name, Input_file*,
                off_t offset, const unsigned char* p,
-               section_offset_type bytes);
+               section_offset_type bytes, bool* punconfigured);
 
 } // end namespace gold
 
This page took 0.024162 seconds and 4 git commands to generate.