aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/BinaryFormat/Magic.cpp
diff options
context:
space:
mode:
authorAnirudh Prasad <anirudh_prasad@hotmail.com>2021-07-20 10:50:18 -0400
committerAnirudh Prasad <anirudh_prasad@hotmail.com>2021-07-20 10:50:47 -0400
commit0977f31cecf8aa4ad1be72748179f4d6a902daf4 (patch)
tree46535babc10d848540b6a4229a46cbe77cf62487 /llvm/lib/BinaryFormat/Magic.cpp
parentfd855c24c72ce01573d726317acaaefc9809d9dc (diff)
downloadllvm-0977f31cecf8aa4ad1be72748179f4d6a902daf4.zip
llvm-0977f31cecf8aa4ad1be72748179f4d6a902daf4.tar.gz
llvm-0977f31cecf8aa4ad1be72748179f4d6a902daf4.tar.bz2
[SystemZ][z/OS] Add GOFF support to file magic identification
- This patch adds in the GOFF format to the file magic identification logic in LLVM - Currently, for the object file support, GOFF is marked as having as an error - However, this is only temporary until https://reviews.llvm.org/D98437 is merged in Reviewed By: abhina.sreeskantharajan Differential Revision: https://reviews.llvm.org/D105993
Diffstat (limited to 'llvm/lib/BinaryFormat/Magic.cpp')
-rw-r--r--llvm/lib/BinaryFormat/Magic.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/BinaryFormat/Magic.cpp b/llvm/lib/BinaryFormat/Magic.cpp
index 591da48..8c7f7b7 100644
--- a/llvm/lib/BinaryFormat/Magic.cpp
+++ b/llvm/lib/BinaryFormat/Magic.cpp
@@ -71,6 +71,11 @@ file_magic llvm::identify_magic(StringRef Magic) {
return file_magic::xcoff_object_64;
break;
+ case 0x03:
+ if (startswith(Magic, "\x03\xF0\x00"))
+ return file_magic::goff_object;
+ break;
+
case 0xDE: // 0x0B17C0DE = BC wraper
if (startswith(Magic, "\xDE\xC0\x17\x0B"))
return file_magic::bitcode;