bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/14718] New: ld crashes on ARMv5 due to unaligned memory access


From: ambrop7 at gmail dot com
Subject: [Bug ld/14718] New: ld crashes on ARMv5 due to unaligned memory access
Date: Sun, 14 Oct 2012 14:14:05 +0000


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



             Bug #: 14718

           Summary: ld crashes on ARMv5 due to unaligned memory access

           Product: binutils

           Version: 2.22

            Status: NEW

          Severity: normal

          Priority: P2

         Component: ld

        AssignedTo: address@hidden

        ReportedBy: address@hidden

    Classification: Unclassified





Created attachment 6686

  --> http://sourceware.org/bugzilla/attachment.cgi?id=6686

hackish fix



See Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=433669



With binutils 2.22, gcc 4.5.4 on an ARMv5 system, ld crashes when static

linking a program:



# gcc -static hello.c

collect2: ld terminated with signal 11 [Segmentation fault]



The input can be anything, like "int main () { return 0; }".



I've tracked it down to misaligned memory accesses in bfd/elf32-arm.c. The

attached patch fixes the misaligned access, the crash no longer occurs and the

resulting program runs.



Note that this patch uses a gcc-only feature (attribute packed which makes the

compiler handle misalignment in software). It's probably not suitable for

inclusion into binutils as-is if binutils is to compile with something other

than gcc. Instead of this, memcpy() can be used to read and write misaligned

memory in a standard way.



-- 

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]