Fix assorted ChangeLog errors
[deliverable/binutils-gdb.git] / gold / target.h
index 8dabc281ef58abc9b0c4a3ce33e4fc8fe60b8829..d28491cecdf2cd33ec8bcc6a2aea72d45c29daad 100644 (file)
@@ -1,6 +1,6 @@
 // target.h -- target support for gold   -*- C++ -*-
 
-// Copyright (C) 2006-2014 Free Software Foundation, Inc.
+// Copyright (C) 2006-2015 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -36,6 +36,7 @@
 #include "elfcpp.h"
 #include "options.h"
 #include "parameters.h"
+#include "stringpool.h"
 #include "debug.h"
 
 namespace gold
@@ -61,6 +62,7 @@ class Output_section;
 class Input_objects;
 class Task;
 struct Symbol_location;
+class Versions;
 
 // The abstract class for target specific handling.
 
@@ -336,10 +338,12 @@ class Target
   void
   calls_non_split(Relobj* object, unsigned int shndx,
                  section_offset_type fnoffset, section_size_type fnsize,
+                 const unsigned char* prelocs, size_t reloc_count,
                  unsigned char* view, section_size_type view_size,
                  std::string* from, std::string* to) const
   {
-    this->do_calls_non_split(object, shndx, fnoffset, fnsize, view, view_size,
+    this->do_calls_non_split(object, shndx, fnoffset, fnsize,
+                            prelocs, reloc_count, view, view_size,
                             from, to);
   }
 
@@ -453,6 +457,41 @@ class Target
   entry_symbol_name() const
   { return this->pti_->entry_symbol_name; }
 
+  // Return the size in bits of SHT_HASH entry.
+  int
+  hash_entry_size() const
+  { return this->pti_->hash_entry_size; }
+
+  // Whether the target has a custom set_dynsym_indexes method.
+  bool
+  has_custom_set_dynsym_indexes() const
+  { return this->do_has_custom_set_dynsym_indexes(); }
+
+  // Custom set_dynsym_indexes method for a target.
+  unsigned int
+  set_dynsym_indexes(std::vector<Symbol*>* dyn_symbols, unsigned int index,
+                     std::vector<Symbol*>* syms, Stringpool* dynpool,
+                     Versions* versions, Symbol_table* symtab) const
+  {
+    return this->do_set_dynsym_indexes(dyn_symbols, index, syms, dynpool,
+                                       versions, symtab);
+  }
+
+  // Get the custom dynamic tag value.
+  unsigned int
+  dynamic_tag_custom_value(elfcpp::DT tag) const
+  { return this->do_dynamic_tag_custom_value(tag); }
+
+  // Adjust the value written to the dynamic symbol table.
+  void
+  adjust_dyn_symbol(const Symbol* sym, unsigned char* view) const
+  { this->do_adjust_dyn_symbol(sym, view); }
+
+  // Return whether to include the section in the link.
+  bool
+  should_include_section(elfcpp::Elf_Word sh_type) const
+  { return this->do_should_include_section(sh_type); }
+
  protected:
   // This struct holds the constant information for a child class.  We
   // use a struct to avoid the overhead of virtual function calls for
@@ -508,6 +547,9 @@ class Target
     const char* attributes_vendor;
     // Name of the main entry point to the program.
     const char* entry_symbol_name;
+    // Size (in bits) of SHT_HASH entry. Always equal to 32, except for
+    // 64-bit S/390.
+    const int hash_entry_size;
   };
 
   Target(const Target_info* pti)
@@ -624,7 +666,8 @@ class Target
   // Virtual function which may be overridden by the child class.
   virtual void
   do_calls_non_split(Relobj* object, unsigned int, section_offset_type,
-                    section_size_type, unsigned char*, section_size_type,
+                    section_size_type, const unsigned char*, size_t,
+                    unsigned char*, section_size_type,
                     std::string*, std::string*) const;
 
   // make_elf_object hooks.  There are four versions of these for
@@ -724,6 +767,33 @@ class Target
   do_gc_mark_symbol(Symbol_table*, Symbol*) const
   { }
 
+  // This may be overridden by the child class.
+  virtual bool
+  do_has_custom_set_dynsym_indexes() const
+  { return false; }
+
+  // This may be overridden by the child class.
+  virtual unsigned int
+  do_set_dynsym_indexes(std::vector<Symbol*>*, unsigned int,
+                        std::vector<Symbol*>*, Stringpool*, Versions*,
+                        Symbol_table*) const
+  { gold_unreachable(); }
+
+  // This may be overridden by the child class.
+  virtual unsigned int
+  do_dynamic_tag_custom_value(elfcpp::DT) const
+  { gold_unreachable(); }
+
+  // This may be overridden by the child class.
+  virtual void
+  do_adjust_dyn_symbol(const Symbol*, unsigned char*) const
+  { }
+
+  // This may be overridden by the child class.
+  virtual bool
+  do_should_include_section(elfcpp::Elf_Word) const
+  { return true; }
+
  private:
   // The implementations of the four do_make_elf_object virtual functions are
   // almost identical except for their sizes and endianness.  We use a template.
@@ -867,7 +937,6 @@ class Sized_target : public Target
                  Output_section* output_section,
                  typename elfcpp::Elf_types<size>::Elf_Off
                     offset_in_output_section,
-                 const Relocatable_relocs*,
                  unsigned char* view,
                  typename elfcpp::Elf_types<size>::Elf_Addr view_address,
                  section_size_type view_size,
@@ -937,6 +1006,14 @@ class Sized_target : public Target
   plt_entry_size() const
   { gold_unreachable(); }
 
+  // Return the size of each GOT entry.  This is only used for
+  // laying out the incremental link info sections.  A target needs
+  // to implement this if its GOT size is different.
+
+  virtual unsigned int
+  got_entry_size() const
+  { return size / 8; }
+
   // Create the GOT and PLT sections for an incremental update.
   // A target needs to implement this to support incremental linking.
 
@@ -997,9 +1074,9 @@ class Sized_target : public Target
   // and DST_OFF.
   void
   gc_add_reference(Symbol_table* symtab,
-                  Object* src_obj,
+                  Relobj* src_obj,
                   unsigned int src_shndx,
-                  Object* dst_obj,
+                  Relobj* dst_obj,
                   unsigned int dst_shndx,
                   typename elfcpp::Elf_types<size>::Elf_Addr dst_off) const
   {
@@ -1021,8 +1098,8 @@ class Sized_target : public Target
 
   // Handle target specific gc actions when adding a gc reference.
   virtual void
-  do_gc_add_reference(Symbol_table*, Object*, unsigned int,
-                     Object*, unsigned int,
+  do_gc_add_reference(Symbol_table*, Relobj*, unsigned int,
+                     Relobj*, unsigned int,
                      typename elfcpp::Elf_types<size>::Elf_Addr) const
   { }
 
This page took 0.025903 seconds and 4 git commands to generate.