diff options
author | Fangrui Song <maskray@google.com> | 2020-03-19 22:58:42 -0700 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2020-03-20 11:18:36 -0700 |
commit | 7899fe9da8d8df6f19ddcbbb877ea124d711c54b (patch) | |
tree | fcb5fc3fea01c2d093e129b8d07afe5440a583cf /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | fe5937cb33b7753ff95edbe7cbd3be549961b733 (diff) | |
download | llvm-7899fe9da8d8df6f19ddcbbb877ea124d711c54b.zip llvm-7899fe9da8d8df6f19ddcbbb877ea124d711c54b.tar.gz llvm-7899fe9da8d8df6f19ddcbbb877ea124d711c54b.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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: |