diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-06-18 15:03:28 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-06-18 15:03:28 +0000 |
commit | 9c22f87b1374b06dc6c07f6e8047890e390bbe2d (patch) | |
tree | 4b4111e1ecfdffcfc137e357afdb764d72ea3696 /include/llvm/Object/MachOFormat.h | |
parent | 79ac9c8402d4113d42ff2d713c7acdfa800d2397 (diff) | |
download | external_llvm-9c22f87b1374b06dc6c07f6e8047890e390bbe2d.zip external_llvm-9c22f87b1374b06dc6c07f6e8047890e390bbe2d.tar.gz external_llvm-9c22f87b1374b06dc6c07f6e8047890e390bbe2d.tar.bz2 |
Basic support for parsing Mach-O universal binaries in LLVMObject library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Object/MachOFormat.h')
-rw-r--r-- | include/llvm/Object/MachOFormat.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/llvm/Object/MachOFormat.h b/include/llvm/Object/MachOFormat.h index ffca391..96ee8a7 100644 --- a/include/llvm/Object/MachOFormat.h +++ b/include/llvm/Object/MachOFormat.h @@ -95,6 +95,8 @@ namespace macho { enum StructureSizes { Header32Size = 28, Header64Size = 32, + FatHeaderSize = 8, + FatArchHeaderSize = 20, SegmentLoadCommand32Size = 56, SegmentLoadCommand64Size = 72, Section32Size = 68, @@ -130,6 +132,22 @@ namespace macho { uint32_t Reserved; }; + /// \brief Header for universal object files. + struct FatHeader { + uint32_t Magic; + uint32_t NumFatArch; + }; + + /// \brief Header for a single-architecture object file in a + /// universal binary. + struct FatArchHeader { + uint32_t CPUType; + uint32_t CPUSubtype; + uint32_t Offset; + uint32_t Size; + uint32_t Align; + }; + // See <mach-o/loader.h>. enum HeaderFileType { HFT_Object = 0x1 |