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]

[PATCH][GOLD] Update Stub_table class to handle Cortex-A8 stubs.


Hi,

    This patch mainly changes the Stub_table class to handle Cortex-A8
stubs.  At the end of a relaxation pass, we compute the data size and
address alignment of the table and compare them with those of the
previous pass.  If all the stub tables have data sizes and address
alignments as the previous pass,  the relaxation loop stops.
Previously we just looked at the relocation stubs and relaxation
stopped if no new stubs were added.  This does not work well because
we add and remove Cortex-A8 stubs during relaxation.  There are also
some changes in Arm_relobj and Target_arm classes for the Stub_table
class updates.   I also added some changes in the Insn_template class
that were missing in my previous patch.

-Doug

2010-01-07  Doug Kwan  <dougkwan@google.com>

        * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
          prev_data_size_ and prev_addralign_.  Remove initializer for
          deleted data member has_been_changed_.
          (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
          to determine if the table is empty.
          (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
          Remove.
          (Stub_table::add_reloc_stub): Define method in class definition
          instead of just declaring it there.
          (Stub_table::add_cortex_a8_stub): New method definition.
          (Stub_table::update_data_size_and_addralign): Ditto.
          (Stub_table::finalize_stubs): Ditto.
          (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
          (Stub_table::do_addralign_): Return address alignment in the
          (Stub_table::do_reset_address_and_file_offset): Define method in
          class definition instead of declaring it there.  Set current data
          size to be the data size of the previous pass.
          (Stub_table::set_final_data_size): Use current data size as the
          final data size.
          (Stub_table::relocate_stub): Change parameter type of stub from
          Reloc_stub pointer to Stub pointer.
          (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
          (Stub_table::Cortex_a8_stub_list): New typedef.
          (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
           Stub_table::prev_addralign_): New data member.
          (Arm_relobj::Arm_relobj): Initialize data member
          section_has_cortex_a8_workaround_.
          (Arm_relobj::section_has_cortex_a8_workaround,
           Arm_relobj::mark_section_for_cortex_a8_workaround): New method
           definitions.
          (Arm_relobj::section_has_cortex_a8_workaround_): New data member
          declarations.
          (Target_arm::relocate_stub): Change parameter type of stub from
          Reloc_stub pointer to Stub pointer.
          (Insn_template::size, Insn_template::alignment): Handle
          THUMB16_SPECIAL_TYPE.
          (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
           Stub_table::update_data_size_and_addralign,
           Stub_table::apply_cortex_a8_workaround_to_address_range): New method
          definitions.
          (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
          (Stub_table::do_write): Ditto.
          (Target_arm::do_relax): Adjust code for changes in Stub_table.

Attachment: patch.txt
Description: Text document


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