+ section_size_type view_size,
+ const Reloc_symbol_changes*) = 0;
+
+ // Scan the relocs during a relocatable link. The parameters are
+ // like scan_relocs, with an additional Relocatable_relocs
+ // parameter, used to record the disposition of the relocs.
+ virtual void
+ scan_relocatable_relocs(Symbol_table* symtab,
+ Layout* layout,
+ Sized_relobj_file<size, big_endian>* object,
+ unsigned int data_shndx,
+ 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,
+ Relocatable_relocs*) = 0;
+
+ // Scan the relocs for --emit-relocs. The parameters are
+ // like scan_relocatable_relocs.
+ virtual void
+ emit_relocs_scan(Symbol_table* symtab,
+ Layout* layout,
+ Sized_relobj_file<size, big_endian>* object,
+ unsigned int data_shndx,
+ 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_syms,
+ Relocatable_relocs* rr) = 0;
+
+ // Emit relocations for a section during a relocatable link, and for
+ // --emit-relocs. The parameters are like relocate_section, with
+ // additional parameters for the view of the output reloc section.
+ virtual void
+ relocate_relocs(const Relocate_info<size, big_endian>*,
+ unsigned int sh_type,
+ const unsigned char* prelocs,
+ size_t reloc_count,
+ Output_section* output_section,
+ typename elfcpp::Elf_types<size>::Elf_Off
+ offset_in_output_section,
+ unsigned char* view,
+ typename elfcpp::Elf_types<size>::Elf_Addr view_address,
+ section_size_type view_size,
+ unsigned char* reloc_view,
+ section_size_type reloc_view_size) = 0;
+
+ // Perform target-specific processing in a relocatable link. This is
+ // only used if we use the relocation strategy RELOC_SPECIAL.
+ // RELINFO points to a Relocation_info structure. SH_TYPE is the relocation
+ // section type. PRELOC_IN points to the original relocation. RELNUM is
+ // the index number of the relocation in the relocation section.
+ // OUTPUT_SECTION is the output section to which the relocation is applied.
+ // OFFSET_IN_OUTPUT_SECTION is the offset of the relocation input section
+ // within the output section. VIEW points to the output view of the
+ // output section. VIEW_ADDRESS is output address of the view. VIEW_SIZE
+ // is the size of the output view and PRELOC_OUT points to the new
+ // relocation in the output object.
+ //
+ // A target only needs to override this if the generic code in
+ // target-reloc.h cannot handle some relocation types.
+
+ virtual void
+ relocate_special_relocatable(const Relocate_info<size, big_endian>*
+ /*relinfo */,
+ unsigned int /* sh_type */,
+ const unsigned char* /* preloc_in */,
+ size_t /* relnum */,
+ Output_section* /* output_section */,
+ typename elfcpp::Elf_types<size>::Elf_Off
+ /* offset_in_output_section */,
+ unsigned char* /* view */,
+ typename elfcpp::Elf_types<size>::Elf_Addr
+ /* view_address */,
+ section_size_type /* view_size */,
+ unsigned char* /* preloc_out*/)
+ { gold_unreachable(); }
+
+ // Return the number of entries in the GOT. This is only used for
+ // laying out the incremental link info sections. A target needs
+ // to implement this to support incremental linking.
+
+ virtual unsigned int
+ got_entry_count() const
+ { gold_unreachable(); }
+
+ // Return the number of entries in the PLT. This is only used for
+ // laying out the incremental link info sections. A target needs
+ // to implement this to support incremental linking.
+
+ virtual unsigned int
+ plt_entry_count() const
+ { gold_unreachable(); }
+
+ // Return the offset of the first non-reserved PLT entry. This is
+ // only used for laying out the incremental link info sections.
+ // A target needs to implement this to support incremental linking.
+
+ virtual unsigned int
+ first_plt_entry_offset() const
+ { gold_unreachable(); }
+
+ // Return the size of each PLT entry. This is only used for
+ // laying out the incremental link info sections. A target needs
+ // to implement this to support incremental linking.
+
+ virtual unsigned int
+ 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.
+
+ virtual Output_data_got_base*
+ init_got_plt_for_update(Symbol_table*,
+ Layout*,
+ unsigned int /* got_count */,
+ unsigned int /* plt_count */)
+ { gold_unreachable(); }
+
+ // Reserve a GOT entry for a local symbol, and regenerate any
+ // necessary dynamic relocations.
+ virtual void
+ reserve_local_got_entry(unsigned int /* got_index */,
+ Sized_relobj<size, big_endian>* /* obj */,
+ unsigned int /* r_sym */,
+ unsigned int /* got_type */)
+ { gold_unreachable(); }
+
+ // Reserve a GOT entry for a global symbol, and regenerate any
+ // necessary dynamic relocations.
+ virtual void
+ reserve_global_got_entry(unsigned int /* got_index */, Symbol* /* gsym */,
+ unsigned int /* got_type */)
+ { gold_unreachable(); }
+
+ // Register an existing PLT entry for a global symbol.
+ // A target needs to implement this to support incremental linking.
+
+ virtual void
+ register_global_plt_entry(Symbol_table*, Layout*,
+ unsigned int /* plt_index */,
+ Symbol*)
+ { gold_unreachable(); }
+
+ // Force a COPY relocation for a given symbol.
+ // A target needs to implement this to support incremental linking.
+
+ virtual void
+ emit_copy_reloc(Symbol_table*, Symbol*, Output_section*, off_t)
+ { gold_unreachable(); }
+
+ // Apply an incremental relocation.
+
+ virtual void
+ apply_relocation(const Relocate_info<size, big_endian>* /* relinfo */,
+ typename elfcpp::Elf_types<size>::Elf_Addr /* r_offset */,
+ unsigned int /* r_type */,
+ typename elfcpp::Elf_types<size>::Elf_Swxword /* r_addend */,
+ const Symbol* /* gsym */,
+ unsigned char* /* view */,
+ typename elfcpp::Elf_types<size>::Elf_Addr /* address */,
+ section_size_type /* view_size */)
+ { gold_unreachable(); }
+
+ // Handle target specific gc actions when adding a gc reference from
+ // SRC_OBJ, SRC_SHNDX to a location specified by DST_OBJ, DST_SHNDX
+ // and DST_OFF.
+ void
+ gc_add_reference(Symbol_table* symtab,
+ Relobj* src_obj,
+ unsigned int src_shndx,
+ Relobj* dst_obj,
+ unsigned int dst_shndx,
+ typename elfcpp::Elf_types<size>::Elf_Addr dst_off) const
+ {
+ this->do_gc_add_reference(symtab, src_obj, src_shndx,
+ dst_obj, dst_shndx, dst_off);
+ }
+
+ // Return the r_sym field from a relocation.
+ // Most targets can use the default version of this routine,
+ // but some targets have a non-standard r_info field, and will
+ // need to provide a target-specific version.
+ virtual unsigned int
+ get_r_sym(const unsigned char* preloc) const
+ {
+ // Since REL and RELA relocs share the same structure through
+ // the r_info field, we can just use REL here.
+ elfcpp::Rel<size, big_endian> rel(preloc);
+ return elfcpp::elf_r_sym<size>(rel.get_r_info());
+ }
+
+ // Record a target-specific program property in the .note.gnu.property
+ // section.
+ virtual void
+ record_gnu_property(unsigned int, unsigned int, size_t,
+ const unsigned char*, const Object*)
+ { }
+
+ // Merge the target-specific program properties from the current object.
+ virtual void
+ merge_gnu_properties(const Object*)
+ { }