From aa558a78b26c4139f379a2546b9f197a4839c60c Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 6 Mar 2014 23:02:15 +0000 Subject: [PATCH] Reapply "MC: simplify object file selection for Windows" That was overly aggressive in assuming that we could always assume COFF. Some of the tests assume that they will get ELF rather than COFF even on Windows where the default is COFF. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203176 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCObjectFileInfo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp index 6b21cd3dd1c..4211b179dce 100644 --- a/lib/MC/MCObjectFileInfo.cpp +++ b/lib/MC/MCObjectFileInfo.cpp @@ -739,9 +739,8 @@ void MCObjectFileInfo::InitMCObjectFileInfo(StringRef TT, Reloc::Model relocm, (T.isOSDarwin() || T.isOSBinFormatMachO())) { Env = IsMachO; InitMachOMCObjectFileInfo(T); - } else if (T.isOSWindows() && !T.isOSBinFormatELF()) { - assert((Arch == Triple::x86 || Arch == Triple::x86_64) && - "expected x86 or x86_64"); + } else if ((Arch == Triple::x86 || Arch == Triple::x86_64) && + T.getObjectFormat() != Triple::ELF && T.isOSWindows()) { Env = IsCOFF; InitCOFFMCObjectFileInfo(T); } else {