summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2018-10-08 15:19:23 -0700
committerPirama Arumuga Nainar <pirama@google.com>2018-10-09 00:56:49 +0000
commit2245cc50640cda3d695525a2fdd935f227615af1 (patch)
treee9e5e445d2e08c1c1881792da08581b41e3c285f
parent44492f8e438f8ce42a254699ba8496eb76075e00 (diff)
downloadbinutils-2245cc50640cda3d695525a2fdd935f227615af1.tar.gz
Bug: http://b/117439724 Without specifying alignment, if __CTOR_LIST__ is not aligned to 4 bytes, we end up with garbage after the -1. This causes access violations in __do_global_ctors. The 64-bit version aligns it to 8 bytes (ld/scrpittempl/pep.sc). Test: With this fix, AOSP Windows tools built with Clang + MinGW + libc++ no longer crash. Change-Id: I76be11a265cdcf272d740fa8715024f1f6df3e1b
-rw-r--r--binutils-2.27/ld/scripttempl/pe.sc1
1 files changed, 1 insertions, 0 deletions
diff --git a/binutils-2.27/ld/scripttempl/pe.sc b/binutils-2.27/ld/scripttempl/pe.sc
index 59e4e89e..299c4adf 100644
--- a/binutils-2.27/ld/scripttempl/pe.sc
+++ b/binutils-2.27/ld/scripttempl/pe.sc
@@ -92,6 +92,7 @@ SECTIONS
${RELOCATING+ *(.gnu.linkonce.t.*)}
*(.glue_7t)
*(.glue_7)
+ ${CONSTRUCTING+. = ALIGN(4);}
${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0); }
${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;