[LLD][COFF] Fix ordering of CRT global initializers in COMDAT sections
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Fri, 5 Oct 2018 12:56:46 +0000 (12:56 +0000)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Fri, 5 Oct 2018 12:56:46 +0000 (12:56 +0000)
commit149de8de19064a599c64975b3b218e7ce5f2aaa3
treed7e3cac044ac91fbfedf83aa52a88b2d69461a2f
parent3c19674facae1853aa83ddc57f0700a014dc88bc
[LLD][COFF] Fix ordering of CRT global initializers in COMDAT sections

(patch by Benoit Rousseau)

This patch fixes a bug where the global variable initializers were sometimes not invoked in the correct order when it involved a C++ template instantiation.

Differential Revision: https://reviews.llvm.org/D52749

llvm-svn: 343847
lld/COFF/Chunks.cpp
lld/COFF/Chunks.h
lld/COFF/Writer.cpp
lld/test/COFF/Inputs/crt-dyn-initializer-order_1.yaml [new file with mode: 0644]
lld/test/COFF/Inputs/crt-dyn-initializer-order_2.yaml [new file with mode: 0644]
lld/test/COFF/crt-dyn-initializer-order.test [new file with mode: 0644]