gold: Fix 64-bit sparc GOLD crash in gdb-index code.
[binutils-gdb.git] / gold / target-select.h
index e16afd263f5ef63a7acbc0a2183dabfab1f45ada..310c0b97d8c567cc85998927157e0c5e94b3686b 100644 (file)
@@ -140,6 +140,13 @@ class Target_selector
   emulation() const
   { return this->emulation_; }
 
+  // The reverse mapping, for --print-output-format: if we
+  // instantiated TARGET, return our BFD_NAME.  If we did not
+  // instantiate it, return NULL.
+  const char*
+  target_bfd_name(const Target* target)
+  { return this->do_target_bfd_name(target); }
+
  protected:
   // Return an instance of the real target.  This must be implemented
   // by the child class.
@@ -192,10 +199,19 @@ class Target_selector
     emulations->push_back(this->emulation_);
   }
 
+  // Map from target to BFD name.
+  virtual const char*
+  do_target_bfd_name(const Target*);
+
   // Instantiate the target and return it.
   Target*
   instantiate_target();
 
+  // Return whether TARGET is the target we instantiated.
+  bool
+  is_our_target(const Target* target)
+  { return target == this->instantiated_target_; }
+
  private:
   // Set the target.
   void
@@ -249,6 +265,11 @@ supported_target_names(std::vector<const char*>*);
 extern void
 supported_emulation_names(std::vector<const char*>*);
 
+// Print the output format, for the --print-output-format option.
+
+extern void
+print_output_format();
+
 } // End namespace gold.
 
 #endif // !defined(GOLD_TARGET_SELECT_H)