summaryrefslogtreecommitdiff
path: root/include/llvm/Object/MachOFormat.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-11-27 04:59:14 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-11-27 04:59:14 +0000
commitf52788f4e6951ac8b6e46100eb5ee6a0a4244a00 (patch)
tree26bcbd4565c2c36f598faf208bf57098f7720593 /include/llvm/Object/MachOFormat.h
parent36d76a8dbc87b62de82a4a8c0d7cb4bb2a202934 (diff)
downloadllvm-f52788f4e6951ac8b6e46100eb5ee6a0a4244a00.tar.gz
llvm-f52788f4e6951ac8b6e46100eb5ee6a0a4244a00.tar.bz2
llvm-f52788f4e6951ac8b6e46100eb5ee6a0a4244a00.tar.xz
MC/Mach-O: Migrate more constants into MachOFormat.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Object/MachOFormat.h')
-rw-r--r--include/llvm/Object/MachOFormat.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/include/llvm/Object/MachOFormat.h b/include/llvm/Object/MachOFormat.h
index 45ed725603..61a19643f0 100644
--- a/include/llvm/Object/MachOFormat.h
+++ b/include/llvm/Object/MachOFormat.h
@@ -104,6 +104,75 @@ namespace macho {
Nlist64Size = 16,
RelocationInfoSize = 8
};
+
+ // See <mach-o/loader.h>.
+ enum HeaderFileType {
+ HFT_Object = 0x1
+ };
+
+ enum HeaderFlags {
+ HF_SubsectionsViaSymbols = 0x2000
+ };
+
+ enum LoadCommandType {
+ LCT_Segment = 0x1,
+ LCT_Symtab = 0x2,
+ LCT_Dysymtab = 0xb,
+ LCT_Segment64 = 0x19
+ };
+
+ // See <mach-o/nlist.h>.
+ enum SymbolTypeType {
+ STT_Undefined = 0x00,
+ STT_Absolute = 0x02,
+ STT_Section = 0x0e
+ };
+
+ enum SymbolTypeFlags {
+ // If any of these bits are set, then the entry is a stab entry number (see
+ // <mach-o/stab.h>. Otherwise the other masks apply.
+ STF_StabsEntryMask = 0xe0,
+
+ STF_TypeMask = 0x0e,
+ STF_External = 0x01,
+ STF_PrivateExtern = 0x10
+ };
+
+ /// IndirectSymbolFlags - Flags for encoding special values in the indirect
+ /// symbol entry.
+ enum IndirectSymbolFlags {
+ ISF_Local = 0x80000000,
+ ISF_Absolute = 0x40000000
+ };
+
+ /// RelocationFlags - Special flags for addresses.
+ enum RelocationFlags {
+ RF_Scattered = 0x80000000
+ };
+
+ enum RelocationInfoType {
+ RIT_Vanilla = 0,
+ RIT_Pair = 1,
+ RIT_Difference = 2,
+ RIT_PreboundLazyPointer = 3,
+ RIT_LocalDifference = 4,
+ RIT_TLV = 5
+ };
+
+ /// X86_64 uses its own relocation types.
+ enum RelocationInfoTypeX86_64 {
+ RIT_X86_64_Unsigned = 0,
+ RIT_X86_64_Signed = 1,
+ RIT_X86_64_Branch = 2,
+ RIT_X86_64_GOTLoad = 3,
+ RIT_X86_64_GOT = 4,
+ RIT_X86_64_Subtractor = 5,
+ RIT_X86_64_Signed1 = 6,
+ RIT_X86_64_Signed2 = 7,
+ RIT_X86_64_Signed4 = 8,
+ RIT_X86_64_TLV = 9
+ };
+
} // end namespace macho
} // end namespace object