2010-02-12 Sriraman Tallam <tmsriram@google.com>
[external/binutils.git] / gold / target.h
index 88cc973..673153f 100644 (file)
@@ -64,6 +64,13 @@ class Target
   virtual ~Target()
   { }
 
+  // Virtual function which is set to return true by a target if
+  // it can use relocation types to determine if a function's
+  // pointer is taken.
+  virtual bool
+  can_check_for_function_pointers() const
+  { return false; }
+
   // Return the bit size that this target implements.  This should
   // return 32 or 64.
   int
@@ -325,6 +332,12 @@ class Target
   attributes_order(int num) const
   { return this->do_attributes_order(num); }
 
+  // When a target is selected as the default target, we call this method,
+  // which may be used for expensive, target-specific initialization.
+  void
+  select_as_default_target()
+  { this->do_select_as_default_target(); } 
+
  protected:
   // This struct holds the constant information for a child class.  We
   // use a struct to avoid the overhead of virtual function calls for
@@ -510,6 +523,11 @@ class Target
   do_attributes_order(int num) const
   { return num; }
 
+  // This may be overridden by the child class.
+  virtual void
+  do_select_as_default_target()
+  { }
+
  private:
   // The implementations of the four do_make_elf_object virtual functions are
   // almost identical except for their sizes and endianity.  We use a template.