http://sourceware.org/bugzilla/show_bug.cgi?id=12771

Ian Lance Taylor <ian at airs dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |dougkwan at google dot com,
                   |                            |ian at airs dot com
         Resolution|WORKSFORME                  |

--- Comment #8 from Ian Lance Taylor <ian at airs dot com> 2011-06-30 06:00:32 
UTC ---
OK, I looked at this a bit more.  It's possible that this is being caused by an
unaligned access.  I see that on ARM an unaligned access will load rotated
bytes.  Does this happen on the emulator?

This object file has unaligned R_ARM_ABS32 relocations against the .debug_info
section.  When the linker fetches the addend for those relocations, it will do
an unaligned read.

Try changing the function Arm_relocate_functions::abs32 around line 3284 of
arm.cc to this:

  // R_ARM_ABS32: (S + A) | T
  static inline typename This::Status
  abs32(unsigned char* view,
    const Sized_relobj_file<32, big_endian>* object,
    const Symbol_value<32>* psymval,
    Arm_address thumb_bit)
  {
    typedef typename elfcpp::Swap<32, big_endian>::Valtype Valtype;
    Valtype addend = elfcpp::Swap_unaligned<32, big_endian>::readval(view);
    Valtype x = psymval->value(object, addend) | thumb_bit;
    elfcpp::Swap_unaligned<32, big_endian>::writeval(view, x);
    return This::STATUS_OKAY;
  }

If that change fixes the crash, then it is indeed an unaligned access problem.

The ARM ELF ABI does suggest that there is no required alignment for
relocations, so it does seem that much of the code in Arm_relocation_functions
needs to use Swap_unaligned rather than Swap.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to