objdump: identify WoA WinCOFF/ARM correctly
[oota-llvm.git] / tools / llvm-objdump / llvm-objdump.cpp
index 9d043f18c2e5ef4db7c71299d5e809527205ce6f..a4b94c9b6adf388bf5d844722ce204a095538d1b 100644 (file)
@@ -167,6 +167,12 @@ static const Target *getTarget(const ObjectFile *Obj = NULL) {
       // the best we can do here is indicate that it is mach-o.
       if (Obj->isMachO())
         TheTriple.setObjectFormat(Triple::MachO);
+
+      if (Obj->isCOFF()) {
+        const auto COFFObj = dyn_cast<COFFObjectFile>(Obj);
+        if (COFFObj->getArch() == Triple::thumb)
+          TheTriple.setTriple("thumbv7-windows");
+      }
     }
   } else
     TheTriple.setTriple(Triple::normalize(TripleName));