Index: gold/object.h =================================================================== RCS file: /cvs/src/src/gold/object.h,v retrieving revision 1.82 diff -u -p -r1.82 object.h --- gold/object.h 15 Oct 2009 00:33:18 -0000 1.82 +++ gold/object.h 24 Oct 2009 21:45:39 -0000 @@ -1648,6 +1648,25 @@ class Sized_relobj : public Relobj local_values() { return &this->local_values_; } + // Views and sizes when relocating. + struct View_size + { + unsigned char* view; + typename elfcpp::Elf_types::Elf_Addr address; + off_t offset; + section_size_type view_size; + bool is_input_output_view; + bool is_postprocessing_view; + }; + + typedef std::vector Views; + + // This may be overriden by a child class. + virtual void + do_relocate_sections(const General_options& options, + const Symbol_table* symtab, const Layout* layout, + const unsigned char* pshdrs, Views* pviews); + private: // For convenience. typedef Sized_relobj This; @@ -1702,19 +1721,6 @@ class Sized_relobj : public Relobj typename This::Shdr& shdr, unsigned int reloc_shndx, unsigned int reloc_type); - // Views and sizes when relocating. - struct View_size - { - unsigned char* view; - typename elfcpp::Elf_types::Elf_Addr address; - off_t offset; - section_size_type view_size; - bool is_input_output_view; - bool is_postprocessing_view; - }; - - typedef std::vector Views; - // Write section data to the output file. Record the views and // sizes in VIEWS for use when relocating. void @@ -1722,8 +1728,10 @@ class Sized_relobj : public Relobj // Relocate the sections in the output file. void - relocate_sections(const General_options& options, const Symbol_table*, - const Layout*, const unsigned char* pshdrs, Views*); + relocate_sections(const General_options& options, const Symbol_table* symtab, + const Layout* layout, const unsigned char* pshdrs, + Views* pviews) + { this->do_relocate_sections(options, symtab, layout, pshdrs, pviews); } // Scan the input relocations for --emit-relocs. void Index: gold/reloc.cc =================================================================== RCS file: /cvs/src/src/gold/reloc.cc,v retrieving revision 1.48 diff -u -p -r1.48 reloc.cc --- gold/reloc.cc 15 Oct 2009 00:33:18 -0000 1.48 +++ gold/reloc.cc 24 Oct 2009 21:45:39 -0000 @@ -799,7 +799,7 @@ Sized_relobj::write_se template void -Sized_relobj::relocate_sections( +Sized_relobj::do_relocate_sections( const General_options& options, const Symbol_table* symtab, const Layout* layout, @@ -1536,6 +1536,50 @@ Sized_relobj<64, true>::do_relocate(cons Output_file* of); #endif +#ifdef HAVE_TARGET_32_LITTLE +template +void +Sized_relobj<32, false>::do_relocate_sections( + const General_options& options, + const Symbol_table* symtab, + const Layout* layout, + const unsigned char* pshdrs, + Views* pviews); +#endif + +#ifdef HAVE_TARGET_32_BIG +template +void +Sized_relobj<32, true>::do_relocate_sections( + const General_options& options, + const Symbol_table* symtab, + const Layout* layout, + const unsigned char* pshdrs, + Views* pviews); +#endif + +#ifdef HAVE_TARGET_64_LITTLE +template +void +Sized_relobj<64, false>::do_relocate_sections( + const General_options& options, + const Symbol_table* symtab, + const Layout* layout, + const unsigned char* pshdrs, + Views* pviews); +#endif + +#ifdef HAVE_TARGET_64_BIG +template +void +Sized_relobj<64, true>::do_relocate_sections( + const General_options& options, + const Symbol_table* symtab, + const Layout* layout, + const unsigned char* pshdrs, + Views* pviews); +#endif + #if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG) template class Merged_symbol_value<32>;