bug-binutils
[Top][All Lists]
Advanced

[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: siarhei.siamashka at gmail dot com
Subject: [Bug ld/14718] ld crashes on ARMv5 due to unaligned memory access
Date: Sun, 14 Oct 2012 20:57:41 +0000


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



Siarhei Siamashka <siarhei.siamashka at gmail dot com> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

                 CC|                            |siarhei.siamashka at gmail

                   |                            |dot com



--- Comment #5 from Siarhei Siamashka <siarhei.siamashka at gmail dot com> 
2012-10-14 20:57:41 UTC ---

Or maybe changing the order like this:



diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c

index 633bb64..0efcf1d 100644

--- a/bfd/elf32-arm.c

+++ b/bfd/elf32-arm.c

@@ -3061,12 +3061,12 @@ elf32_arm_allocate_local_sym_info (bfd *abfd)

       elf_local_got_refcounts (abfd) = (bfd_signed_vma *) data;

       data += num_syms * sizeof (bfd_signed_vma);



-      elf32_arm_local_iplt (abfd) = (struct arm_local_iplt_info **) data;

-      data += num_syms * sizeof (struct arm_local_iplt_info *);

-

       elf32_arm_local_tlsdesc_gotent (abfd) = (bfd_vma *) data;

       data += num_syms * sizeof (bfd_vma);



+      elf32_arm_local_iplt (abfd) = (struct arm_local_iplt_info **) data;

+      data += num_syms * sizeof (struct arm_local_iplt_info *);

+

       elf32_arm_local_got_tls_type (abfd) = data;

     }

   return TRUE;



Because in the current code bfd_signed_vma array (64-bit elements) is followed

by arm_local_iplt_info * array (32-bit elements) and then followed by bfd_vma

array (64-bit elements again). If num_syms is odd, then the last array is not

64-bit aligned. Just swapping the order of the second and third arrays might

help.



-- 

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]