gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gold / target-select.h
index e16afd263f5ef63a7acbc0a2183dabfab1f45ada..51e39a6f10be5749b00426c906f940bc166fc7e9 100644 (file)
@@ -1,6 +1,6 @@
 // target-select.h -- select a target for an object file  -*- C++ -*-
 
-// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2006-2020 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -30,6 +30,7 @@
 namespace gold
 {
 
+class Input_file;
 class Target;
 class Target_selector;
 
@@ -76,8 +77,9 @@ class Target_selector
   // If we can handle this target, return a pointer to a target
   // structure.  The size and endianness are known.
   Target*
-  recognize(int machine, int osabi, int abiversion)
-  { return this->do_recognize(machine, osabi, abiversion); }
+  recognize(Input_file* input_file, off_t offset,
+           int machine, int osabi, int abiversion)
+  { return this->do_recognize(input_file, offset, machine, osabi, abiversion); }
 
   // If NAME matches the target, return a pointer to a target
   // structure.
@@ -140,6 +142,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.
@@ -153,7 +162,7 @@ class Target_selector
   // checks, or to check for multiple machine codes if the machine_
   // field is EM_NONE.
   virtual Target*
-  do_recognize(int, int, int)
+  do_recognize(Input_file*, off_t, int, int, int)
   { return this->instantiate_target(); }
 
   // Recognize a target by name.  When this is called we already know
@@ -192,10 +201,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
@@ -225,7 +243,8 @@ class Target_selector
 // Select the target for an ELF file.
 
 extern Target*
-select_target(int machine, int size, bool big_endian, int osabi,
+select_target(Input_file*, off_t,
+             int machine, int size, bool big_endian, int osabi,
              int abiversion);
 
 // Select a target using a BFD name.
@@ -249,6 +268,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)
This page took 0.028393 seconds and 4 git commands to generate.