diff options
author | Kamlesh Kumar <kamleshbhalui@gmail.com> | 2019-12-16 15:14:08 -0800 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-12-16 15:21:23 -0800 |
commit | aa5ee8f244441a8ea103a7e0ed8b6f3e74454516 (patch) | |
tree | affd1a1ded3287b70ad2e073109bda3f10656ac7 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | d7af86bdd0bdc9509fd7fdc3ae34bb0f4b9d269f (diff) | |
download | bcm5719-llvm-aa5ee8f244441a8ea103a7e0ed8b6f3e74454516.tar.gz bcm5719-llvm-aa5ee8f244441a8ea103a7e0ed8b6f3e74454516.zip |
Honor -fuse-init-array when os is not specified on x86
Currently -fuse-init-array option is not effective when target triple
does not specify os, on x86,x86_64.
i.e.
// -fuse-init-array is not honored.
$ clang -target i386 -fuse-init-array test.c -S
// -fuse-init-array is honored.
$ clang -target i386-linux -fuse-init-array test.c -S
This patch fixes first case.
And does cleanup.
Reviewers: rnk, craig.topper, fhahn, echristo
Reviewed By: rnk
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 ee9d388131f..34e96663a09 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -97,6 +97,7 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx, TM = &TgtM; CodeModel::Model CM = TgtM.getCodeModel(); + InitializeELF(TgtM.Options.UseInitArray); switch (TgtM.getTargetTriple().getArch()) { case Triple::arm: |