diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-04-17 06:17:23 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-04-17 06:17:23 +0000 |
commit | 67283b8a5e196f30a42a3611494eb785ef8fd500 (patch) | |
tree | 17b351645e40e68b8ee771c28bc712fe7659827a /tools/llvm-objdump | |
parent | c0b8743f35efccc52d97288b09f59089386c83f8 (diff) | |
download | llvm-67283b8a5e196f30a42a3611494eb785ef8fd500.tar.gz llvm-67283b8a5e196f30a42a3611494eb785ef8fd500.tar.bz2 llvm-67283b8a5e196f30a42a3611494eb785ef8fd500.tar.xz |
objdump: identify WoA WinCOFF/ARM correctly
Since LLVM currently only supports WinCOFF, assume that the input is WinCOFF
rather than another type of COFF file (ECOFF/XCOFF). If the architecture is
detected as thumb (e.g. the file has a IMAGE_FILE_MACHINE_ARMNT magic) then use
a triple of thumbv7-windows.
This allows for objdump to properly handle WoA object files without having to
specify the target triple manually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-objdump')
-rw-r--r-- | tools/llvm-objdump/llvm-objdump.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp index 9d043f18c2..a4b94c9b6a 100644 --- a/tools/llvm-objdump/llvm-objdump.cpp +++ b/tools/llvm-objdump/llvm-objdump.cpp @@ -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)); |