X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Fllvm%2FObject%2FMachOFormat.h;h=c0f700d3c870ad0125ea3c6f9bf69518aace28b9;hb=b09c146b116359616f6cbd4c8b3328607e00ff42;hp=5a33951e28351195bb22541919015b8136caedbd;hpb=cdffa4fdc91280a517dd3a34b8a06ebdb6ef53fa;p=oota-llvm.git diff --git a/include/llvm/Object/MachOFormat.h b/include/llvm/Object/MachOFormat.h index 5a33951e283..c0f700d3c87 100644 --- a/include/llvm/Object/MachOFormat.h +++ b/include/llvm/Object/MachOFormat.h @@ -61,7 +61,10 @@ namespace mach { CSARM_V6 = 6, CSARM_V5TEJ = 7, CSARM_XSCALE = 8, - CSARM_V7 = 9 + CSARM_V7 = 9, + CSARM_V7F = 10, + CSARM_V7S = 11, + CSARM_V7K = 12 }; /// \brief PowerPC Machine Subtypes. @@ -97,7 +100,8 @@ namespace macho { DysymtabLoadCommandSize = 80, Nlist32Size = 12, Nlist64Size = 16, - RelocationInfoSize = 8 + RelocationInfoSize = 8, + LinkeditLoadCommandSize = 16 }; /// \brief Constants for header magic field. @@ -137,7 +141,11 @@ namespace macho { LCT_Symtab = 0x2, LCT_Dysymtab = 0xb, LCT_Segment64 = 0x19, - LCT_UUID = 0x1b + LCT_UUID = 0x1b, + LCT_CodeSignature = 0x1d, + LCT_SegmentSplitInfo = 0x1e, + LCT_FunctionStarts = 0x26, + LCT_DataInCode = 0x29 }; /// \brief Load command structure. @@ -218,6 +226,13 @@ namespace macho { uint32_t NumLocalRelocationTableEntries; }; + struct LinkeditDataLoadCommand { + uint32_t Type; + uint32_t Size; + uint32_t DataOffset; + uint32_t DataSize; + }; + /// @} /// @name Section Data /// @{ @@ -261,6 +276,10 @@ namespace macho { uint16_t Flags; uint32_t Value; }; + // Despite containing a uint64_t, this structure is only 4-byte aligned within + // a MachO file. +#pragma pack(push) +#pragma pack(4) struct Symbol64TableEntry { uint32_t StringIndex; uint8_t Type; @@ -268,6 +287,19 @@ namespace macho { uint16_t Flags; uint64_t Value; }; +#pragma pack(pop) + + /// @} + /// @name Data-in-code Table Entry + /// @{ + + // See . + enum DataRegionType { Data = 1, JumpTable8, JumpTable16, JumpTable32 }; + struct DataInCodeTableEntry { + uint32_t Offset; /* from mach_header to start of data region */ + uint16_t Length; /* number of bytes in data region */ + uint16_t Kind; /* a DataRegionType value */ + }; /// @} /// @name Indirect Symbol Table @@ -317,17 +349,24 @@ namespace macho { RF_Scattered = 0x80000000 }; + /// Common relocation info types. enum RelocationInfoType { RIT_Vanilla = 0, RIT_Pair = 1, - RIT_Difference = 2, - RIT_PreboundLazyPointer = 3, - RIT_LocalDifference = 4, - RIT_TLV = 5 + RIT_Difference = 2 + }; + + /// Generic relocation info types, which are shared by some (but not all) + /// platforms. + enum RelocationInfoType_Generic { + RIT_Generic_PreboundLazyPointer = 3, + RIT_Generic_LocalDifference = 4, + RIT_Generic_TLV = 5 }; /// X86_64 uses its own relocation types. enum RelocationInfoTypeX86_64 { + // Note that x86_64 doesn't even share the common relocation types. RIT_X86_64_Unsigned = 0, RIT_X86_64_Signed = 1, RIT_X86_64_Branch = 2, @@ -340,16 +379,16 @@ namespace macho { RIT_X86_64_TLV = 9 }; - /// ARM also has its own relocation types. + /// ARM uses its own relocation types. enum RelocationInfoTypeARM { - RIT_ARM_Vanilla = 0, - RIT_ARM_Pair = 1, - RIT_ARM_Difference = 2, RIT_ARM_LocalDifference = 3, - RIT_ARM_PreboundLazyPointer =4, + RIT_ARM_PreboundLazyPointer = 4, RIT_ARM_Branch24Bit = 5, RIT_ARM_ThumbBranch22Bit = 6, - RIT_ARM_ThumbBranch32Bit = 7 + RIT_ARM_ThumbBranch32Bit = 7, + RIT_ARM_Half = 8, + RIT_ARM_HalfDifference = 9 + }; } // end namespace macho