Align __CTOR_LIST__ to 4 bytes for windows x86
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
diff --git a/binutils-2.27/ld/scripttempl/pe.sc b/binutils-2.27/ld/scripttempl/pe.sc
index 59e4e89..299c4ad 100644
--- a/binutils-2.27/ld/scripttempl/pe.sc
+++ b/binutils-2.27/ld/scripttempl/pe.sc
@@ -92,6 +92,7 @@
${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__ = . ;