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: unassig...@sourceware.org

        ReportedBy: ambr...@gmail.com

    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.

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

Reply via email to