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 | 98938f1e0a7b2ed955fbdfc06ae3277173605e02 (patch) | |
tree | 2f4618c8d3444d8c5e013ad0e6dd56252320d1f7 /llvm/tools/llvm-objdump | |
parent | 1614b2688632a0c0b2fe8bafc5590c11f68c5787 (diff) | |
download | bcm5719-llvm-98938f1e0a7b2ed955fbdfc06ae3277173605e02.tar.gz bcm5719-llvm-98938f1e0a7b2ed955fbdfc06ae3277173605e02.zip |
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.
llvm-svn: 206446
Diffstat (limited to 'llvm/tools/llvm-objdump')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 9d043f18c2e..a4b94c9b6ad 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/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)); |