[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access
From: |
ambrop7 at gmail dot com |
Subject: |
[Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access |
Date: |
Sun, 14 Oct 2012 20:17:01 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=14718
--- Comment #2 from Ambroz Bizjak <ambrop7 at gmail dot com> 2012-10-14
20:17:01 UTC ---
Created attachment 6687
--> http://sourceware.org/bugzilla/attachment.cgi?id=6687
non-hackish fix
This fixes the misalignment by properly aligning pointers. Note that it is only
correct if the layout of the structure allocated in
elf32_arm_allocate_local_sym_info() is irrelevant, and this seems to be the
case. Tested, compiles and runs a hello world.
Note: Yes, the fix is actually correct, at least according to the C11 standard.
It is a consequence of the standard that the alignment of a type always divides
its size (and this makes an object aligned to its size correctly aligned). If
that was not the case, the second element of an array of such objects could be
misaligned even when the first element is aligned.
But note that there seem to be other instances of misaligned access involving
bfd_vma* and bfd_signed_vma* which were not triggered by what I have tested and
may be for architectures other than ARM.
--
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 ld/14718] New: ld crashes on ARMv5 due to unaligned memory access, ambrop7 at gmail dot com, 2012/10/14
- [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access, address@hidden, 2012/10/14
- [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access, vapier at gentoo dot org, 2012/10/14
- [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access,
ambrop7 at gmail dot com <=
- [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access, ambrop7 at gmail dot com, 2012/10/14
- [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access, address@hidden, 2012/10/14
- [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access, siarhei.siamashka at gmail dot com, 2012/10/14
- [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access, ambrop7 at gmail dot com, 2012/10/14
- [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access, siarhei.siamashka at gmail dot com, 2012/10/14
- [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access, ambrop7 at gmail dot com, 2012/10/14
- [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access, siarhei.siamashka at gmail dot com, 2012/10/14