[gold commit] Refactor Output_data_reloc_base::do_write for MIPS-specific relocs

Cary Coutant ccoutant@gmail.com
Tue Mar 8 23:00:00 GMT 2016


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.

-cary


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gold-refactor-reloc.patch
Type: application/octet-stream
Size: 11742 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160308/86aea14c/attachment.obj>


More information about the Binutils mailing list