From 7899fe9da8d8df6f19ddcbbb877ea124d711c54b Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 19 Mar 2020 22:58:42 -0700 Subject: [X86] Reland D71360 Clean up UseInitArray initialization for X86ELFTargetObjectFile UseInitArray is now the CC1 default but TargetLoweringObjectFileELF::UseInitArray still defaults to false. The following two unknown OS target triples continue using .ctors/.dtors because InitializeELF is not called. clang -target i386 -c a.c clang -target x86_64 -c a.c This cleanup fixes this as a bonus. Differential Revision: https://reviews.llvm.org/D71360 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 8f1c342..dedb673 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -108,6 +108,7 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx, TM = &TgtM; CodeModel::Model CM = TgtM.getCodeModel(); + InitializeELF(TgtM.Options.UseInitArray); switch (TgtM.getTargetTriple().getArch()) { case Triple::arm: -- cgit v1.1