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] Handle target specific relocatable relocation.


Hi,

   This patch adds code to handle relocation strategy RELOC_SPECIAL in
target-reloc.h and ARM specific code in arm.cc to handle relocation
types with odd-sizes or incontigious bits.  Previously, all targets
used generic code to handle full 8/16/32/64 bit relocations.  That did
not work on ARM and caused the Linux kernel to be linked incorrectly.
This patch adds a hook Sized_target::relocate_special_relocatable.
For reasons I do not understand, the hooks in Sized_target do not
follow the normal convention in gold for virtual functions involving a
public interface foo() and a protected implementation do_foo().  I
could avoid changing other back-ends and testfile.cc if I used the
normal convention but I follow the local convention in the
Sized_target class.

The patch was tested on x86_64 and ARM Linux with the full gold test suite.

-Doug

2010-05-25  Doug Kwan  <dougkwan@google.com>

        * arm.cc (Arm_scan_relocatable_relocs): New class.
        (Target_arm::relocate_special_relocatable): New method.
        (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
        (Arm_relocate_functions::thumb_branch_common): Same.
        (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
        instead of Default_scan_relocatable_relocs.
        * i386.cc (Target_i386::relocate_special_relocatable): New method.
        * powerpc.cc (Target_powerpc::relocate_special_relocatable): Same.
        * sparc.cc (Target_sparc::relocate_speical_relocatable): Same.
        * target-reloc.h (relocate_for_relocatable): Let target handle
        relocation strategy Relocatable_relocs::RELOC_SPECIAL.
        * target.h (Sized_target::relocate_special_relocatable): New method.
        * x86_64.cc (Target_x86_64::relocate_special_relocatable): Same.
        * testsuite/testfile.cc (Target_test::relocate_special_relocatable):
        Same.

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]