X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gold%2Fsparc.cc;h=c97c32ceb70dae85f640e84295297cf0d8ba2d6d;hb=4d625b70fc3fb7facc7159feb8d49b78ac6641f9;hp=049e0ab8986fc7e66da58424e65312b21e194ba8;hpb=b05b120205e697db6291abb95a8cd2be054f99e9;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/sparc.cc b/gold/sparc.cc index 049e0ab898..c97c32ceb7 100644 --- a/gold/sparc.cc +++ b/gold/sparc.cc @@ -131,6 +131,21 @@ class Target_sparc : public Sized_target const unsigned char* plocal_symbols, Relocatable_relocs*); + // Scan the relocs for --emit-relocs. + void + emit_relocs_scan(Symbol_table* symtab, + Layout* layout, + Sized_relobj_file* 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); + // Emit relocations for a section. void relocate_relocs(const Relocate_info*, @@ -345,15 +360,6 @@ class Target_sparc : public Sized_target unsigned char *reloc_adjust_addr_; }; - // A class which returns the size required for a relocation type, - // used while scanning relocs during a relocatable link. - class Relocatable_size_for_reloc - { - public: - unsigned int - get_size_for_reloc(unsigned int, Relobj*); - }; - // Get the GOT section, creating it if necessary. Output_data_got* got_section(Symbol_table*, Layout*); @@ -3036,9 +3042,10 @@ Target_sparc::gc_process_relocs( { typedef Target_sparc Sparc; typedef typename Target_sparc::Scan Scan; + typedef gold::Default_classify_reloc + Classify_reloc; - gold::gc_process_relocs( + gold::gc_process_relocs( symtab, layout, this, @@ -3070,7 +3077,8 @@ Target_sparc::scan_relocs( const unsigned char* plocal_symbols) { typedef Target_sparc Sparc; - typedef typename Target_sparc::Scan Scan; + typedef gold::Default_classify_reloc + Classify_reloc; if (sh_type == elfcpp::SHT_REL) { @@ -3079,7 +3087,7 @@ Target_sparc::scan_relocs( return; } - gold::scan_relocs( + gold::scan_relocs( symtab, layout, this, @@ -4142,11 +4150,13 @@ Target_sparc::relocate_section( { typedef Target_sparc Sparc; typedef typename Target_sparc::Relocate Sparc_relocate; + typedef gold::Default_classify_reloc + Classify_reloc; gold_assert(sh_type == elfcpp::SHT_RELA); - gold::relocate_section( + gold::relocate_section( relinfo, this, prelocs, @@ -4159,20 +4169,6 @@ Target_sparc::relocate_section( reloc_symbol_changes); } -// Return the size of a relocation while scanning during a relocatable -// link. - -template -unsigned int -Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc( - unsigned int, - Relobj*) -{ - // We are always SHT_RELA, so we should never get here. - gold_unreachable(); - return 0; -} - // Scan the relocs during a relocatable link. template @@ -4191,13 +4187,14 @@ Target_sparc::scan_relocatable_relocs( const unsigned char* plocal_symbols, Relocatable_relocs* rr) { - gold_assert(sh_type == elfcpp::SHT_RELA); + typedef gold::Default_classify_reloc + Classify_reloc; + typedef gold::Default_scan_relocatable_relocs + Scan_relocatable_relocs; - typedef gold::Default_scan_relocatable_relocs Scan_relocatable_relocs; + gold_assert(sh_type == elfcpp::SHT_RELA); - gold::scan_relocatable_relocs( + gold::scan_relocatable_relocs( symtab, layout, object, @@ -4211,6 +4208,45 @@ Target_sparc::scan_relocatable_relocs( rr); } +// Scan the relocs for --emit-relocs. + +template +void +Target_sparc::emit_relocs_scan( + Symbol_table* symtab, + Layout* layout, + Sized_relobj_file* 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) +{ + typedef gold::Default_classify_reloc + Classify_reloc; + typedef gold::Default_emit_relocs_strategy + Emit_relocs_strategy; + + gold_assert(sh_type == elfcpp::SHT_RELA); + + gold::scan_relocatable_relocs( + symtab, + layout, + object, + data_shndx, + prelocs, + reloc_count, + output_section, + needs_special_offset_handling, + local_symbol_count, + plocal_syms, + rr); +} + // Emit relocations for a section. template @@ -4228,9 +4264,12 @@ Target_sparc::relocate_relocs( unsigned char* reloc_view, section_size_type reloc_view_size) { + typedef gold::Default_classify_reloc + Classify_reloc; + gold_assert(sh_type == elfcpp::SHT_RELA); - gold::relocate_relocs( + gold::relocate_relocs( relinfo, prelocs, reloc_count,