This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gold commit] 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.

-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.

Attachment: gold-refactor-reloc.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]