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] Fix for gold/13362


Hi Ian,

   This is the patch for bug 13362.  ARM EABI says that 32-bit static
data relocations have alignment of 1.  Previously, we incorrectly
assume word alignment in a relocatable link.  This patch adds a new
strategy for unaligned 32-bit data relocations, which may be useful
for other targets.  I would have added unaligned 16-bit & 64-bit data
relocations but ARM does not use these and I could not have tested
them.   The patch was tested for both ARM & x86_64.

-Doug


2011-11-09  Doug Kwan  <dougkwan@google.com>

        PR gold/13362
        * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
        Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
        * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
        RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
        (Relocate_functions::rel_unaligned): New.
        (Relocate_functions::rel32_unaligned): New.
        * target-reloc.h (relocate_for_relocatable): Add code to handle
        RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
        * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
        arm_unaligned_reloc_r): New targets.
        * testsuite/Makefile.in: Regenerate.
        * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
        linking.

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]