]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gold/output.cc
Refactor Output_data_reloc_base::do_write for MIPS-specific relocs.
authorCary Coutant <ccoutant@gmail.com>
Tue, 8 Mar 2016 20:24:39 +0000 (12:24 -0800)
committerCary Coutant <ccoutant@gmail.com>
Tue, 8 Mar 2016 23:06:59 +0000 (15:06 -0800)
commitc32482d65c43f40572a0722b48c20b3f571666a3
treec496e6566aaf984af0f0150c9a3325d1032712cc
parentd1ed1c7d69e6656de213b12594e702afec31a66d
Refactor Output_data_reloc_base::do_write for MIPS-specific relocs.

This patch is a simple refactoring that will allow the MIPS backend to
replace the Output_data_reloc_base::do_write() method without copying
its entire implementation. I've moved the implementation of do_write()
into a function template, which can be instantiated with a custom
class to write the MIPS-specific relocation format. The custom class
for MIPS needs access to the symbol index and address from
Output_reloc, so I've included the part of Vlad's MIPS-64 patch that
makes those accessor methods public.

2016-03-08  Cary Coutant  <ccoutant@gmail.com>
            Vladimir Radosavljevic  <vladimir.radosavljevic@imgtec.com>

gold/
* output.cc (Output_reloc_writer): New type.
(Output_data_reloc_base::do_write): Move implementation to template
in output.h and replace with invocation of template.
* output.h (Output_file): Move to top of file.
(Output_reloc::get_symbol_index): Move to public interface.
(Output_reloc::get_address): Likewise.
(Output_data_reloc_base::do_write_generic): New function template.
gold/ChangeLog
gold/output.cc
gold/output.h