Add support for -e and for ENTRY in linker scripts.
[deliverable/binutils-gdb.git] / gold / target.h
index 32166d12a7091b6efdd675454fc14c89b01f519b..218d9f757bbdb9d18737afa353c0e17d061c2ae6 100644 (file)
@@ -43,11 +43,12 @@ class Object;
 template<int size, bool big_endian>
 class Sized_relobj;
 template<int size, bool big_endian>
-struct Relocate_info;
+class Relocate_info;
 class Symbol;
 template<int size>
 class Sized_symbol;
 class Symbol_table;
+class Output_section;
 
 // The abstract class for target specific handling.
 
@@ -133,9 +134,15 @@ class Target
   // basically one or more NOPS which must fill out the specified
   // length in bytes.
   std::string
-  code_fill(off_t length)
+  code_fill(section_size_type length)
   { return this->do_code_fill(length); }
 
+  // Return whether SYM is known to be defined by the ABI.  This is
+  // used to avoid inappropriate warnings about undefined symbols.
+  bool
+  is_defined_by_abi(Symbol* sym) const
+  { return this->do_is_defined_by_abi(sym); }
+
  protected:
   // This struct holds the constant information for a child class.  We
   // use a struct to avoid the overhead of virtual function calls for
@@ -184,9 +191,14 @@ class Target
   // Virtual function which must be implemented by the child class if
   // needed.
   virtual std::string
-  do_code_fill(off_t)
+  do_code_fill(section_size_type)
   { gold_unreachable(); }
 
+  // Virtual function which may be implemented by the child class.
+  virtual bool
+  do_is_defined_by_abi(Symbol*) const
+  { return false; }
+
  private:
   Target(const Target&);
   Target& operator=(const Target&);
@@ -228,9 +240,11 @@ class Sized_target : public Target
   // relocs apply to.  SH_TYPE is the type of the relocation section,
   // SHT_REL or SHT_RELA.  PRELOCS points to the relocation data.
   // RELOC_COUNT is the number of relocs.  LOCAL_SYMBOL_COUNT is the
-  // number of local symbols.  PLOCAL_SYMBOLS points to the local
-  // symbol data from OBJECT.  GLOBAL_SYMBOLS is the array of pointers
-  // to the global symbol table from OBJECT.
+  // number of local symbols.  OUTPUT_SECTION is the output section.
+  // NEEDS_SPECIAL_OFFSET_HANDLING is true if offsets to the output
+  // sections are not mapped as usual.  PLOCAL_SYMBOLS points to the
+  // local symbol data from OBJECT.  GLOBAL_SYMBOLS is the array of
+  // pointers to the global symbol table from OBJECT.
   virtual void
   scan_relocs(const General_options& options,
              Symbol_table* symtab,
@@ -240,24 +254,32 @@ class Sized_target : public Target
              unsigned int sh_type,
              const unsigned char* prelocs,
              size_t reloc_count,
+             Output_section* output_section,
+             bool needs_special_offset_handling,
              size_t local_symbol_count,
-             const unsigned char* plocal_symbols,
-             Symbol** global_symbols) = 0;
+             const unsigned char* plocal_symbols) = 0;
 
   // Relocate section data.  SH_TYPE is the type of the relocation
   // section, SHT_REL or SHT_RELA.  PRELOCS points to the relocation
-  // information.  RELOC_COUNT is the number of relocs.  VIEW is a
-  // view into the output file holding the section contents,
-  // VIEW_ADDRESS is the virtual address of the view, and VIEW_SIZE is
-  // the size of the view.
+  // information.  RELOC_COUNT is the number of relocs.
+  // OUTPUT_SECTION is the output section.
+  // NEEDS_SPECIAL_OFFSET_HANDLING is true if offsets must be mapped
+  // to correspond to the output section.  VIEW is a view into the
+  // output file holding the section contents, VIEW_ADDRESS is the
+  // virtual address of the view, and VIEW_SIZE is the size of the
+  // view.  If NEEDS_SPECIAL_OFFSET_HANDLING is true, the VIEW_xx
+  // parameters refer to the complete output section data, not just
+  // the input section data.
   virtual void
   relocate_section(const Relocate_info<size, big_endian>*,
                   unsigned int sh_type,
                   const unsigned char* prelocs,
                   size_t reloc_count,
+                  Output_section* output_section,
+                  bool needs_special_offset_handling,
                   unsigned char* view,
                   typename elfcpp::Elf_types<size>::Elf_Addr view_address,
-                  off_t view_size) = 0;
+                  section_size_type view_size) = 0;
 
  protected:
   Sized_target(const Target::Target_info* pti)
This page took 0.0242830000000001 seconds and 4 git commands to generate.