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] Use correct local symbol values in stub generation.


Hi

    This patch fixes a problem in which input values of local symbols
are used in stub generation.  We should be using the final output
values instead.  The patch extracts most of the loop body in
Sized_relobj::do_finalize_local_symbols into a new private inline
method Sized_relobj::compute_final_local_value, which is shared by the
Sized_relobj::do_finalize_local_symbols and a public version of
Sized_relobj::compute_final_local_value.   The code in
Target_arm::scan_reloc_section_for_stubs is modifed to call this new
method instead of copying code from there.  This patch also fixes a
problem in which the interface of virtual function
Sized_relobj::do_relocate_sections has been changed recently but the
same function in the child class is not updated accordingly.  It also
adds a map-printing method to the class Arm_exidx_cantunwind so that
-Map options works again.

    I have tested this patch on both x86-64 and ARM.  The patch also
adds a number of new tests.

-Doug


2010-09-02  Doug Kwan  <dougkwan@google.com>

        * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
        (Arm_relobj::do_relocate_sections): Add new parameter for output
        file to match the parent.
        (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
        of local symbols instead of input values.  Update code to track
        changes in gold::relocate_section.
        * object.cc (Sized_relobj::compute_final_local_value): New methods.
        (Sized_relobj::do_finalize_local_symbols): Move code from loop
        body into private version of Sized_relobj::compute_final_local_value.
        Call the inline method.
        * object.h (Symbol_value::Symbol_value): Define destructor.  Free
        merged symbol value if there is one.
        (Symbol_value::has_output_value): New method defintiion.
        (Sized_relobj::Compute_final_local_value_status): New enum type.
        (Sized_relobj::compute_final_local_value): New methods.
        * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
        and arm_cortex_a8.sh.
        (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
        arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
        New tests.
        * Makefile.in: Regenerate.
        * testsuite/arm_bl_out_of_range.s: Update test.
        * testsuite/thumb_bl_out_of_range.s: Ditto.
        * testsuite/thumb_blx_out_of_range.s: Ditto.
        * testsuite/arm_branch_out_of_range.sh: New file.
        * testsuite/arm_cortex_a8.sh: Ditto.
        * testsuite/arm_cortex_a8_b.s: Ditto.
        * testsuite/arm_cortex_a8_b_cond.s: Ditto.
        * testsuite/arm_cortex_a8_b_local.s: Ditto.
        * testsuite/arm_cortex_a8_bl.s: Ditto.
        * testsuite/arm_cortex_a8_blx.s: Ditto.
        * testsuite/arm_cortex_a8_local.s: Ditto.
        * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
        * testsuite/thumb_bl_out_of_range_local.s: Ditto.

Attachment: patch-cortex-a8.txt
Description: Text document


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