14 #ifndef LLVM_SUPPORT_MACHO_H
15 #define LLVM_SUPPORT_MACHO_H
18 #include "llvm/Support/DataTypes.h"
89 #define HANDLE_LOAD_COMMAND(LCName, LCValue, LCStruct) \
93 #include "llvm/Support/MachO.def"
96 #undef HANDLE_LOAD_COMMAND
924 #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)
1341 return (((n_desc) >> 8u) & 0xffu);
1345 n_desc = (((n_desc) & 0x00ff) | (((ordinal) & 0xff) << 8));
1349 return (n_desc >> 8u) & 0x0fu;
1353 n_desc = ((n_desc & 0xf0ffu) | ((align & 0x0fu) << 8u));
1417 return Family | (Model << 4);
1420 return ((
int)ST) & 0x0f;
1423 return ((
int)ST) >> 4;
1737 for (
int i = 0;
i < 13;
i++)
1756 for (
int i = 0;
i < 29;
i++)
1927 #define LOAD_COMMAND_STRUCT(LCStruct) LCStruct LCStruct##_data;
1930 #include "llvm/Support/MachO.def"
void swapStruct(fat_header &mh)
S_NON_LAZY_SYMBOL_POINTERS - Section with non-lazy symbol pointers.
const uint32_t x86_FLOAT_STATE_COUNT
S_SYMBOL_STUBS - Section with symbol stubs, byte size of stub in the Reserved2 field.
S_ATTR_STRIP_STATIC_SYMS - Ok to strip static symbols in this section in files with the MY_DYLDLINK f...
void swapByteOrder(T &Value)
const uint32_t x86_EXCEPTION_STATE64_COUNT
S_ATTR_SELF_MODIFYING_CODE - Used with i386 code stubs written on by dyld.
S_ATTR_LIVE_SUPPORT - Blocks are live if they reference live blocks.
S_ATTR_DEBUG - A debug section.
S_THREAD_LOCAL_VARIABLES - Section with thread local variable structure data.
S_LAZY_DYLIB_SYMBOL_POINTERS - Section with lazy symbol pointers to lazy loaded dylibs.
const uint32_t ARM_THREAD_STATE_COUNT
S_4BYTE_LITERALS - Section with 4 byte literals.
S_8BYTE_LITERALS - Section with 8 byte literals.
S_ATTR_LOC_RELOC - Section has local relocation entries.
S_MOD_TERM_FUNC_POINTERS - Section with only function pointers for termination.
uint32_t objc_module_info_addr
S_ATTR_NO_TOC - Section contains coalesced symbols that are not to be in a ranlib table of contents...
ppc_thread_state32_t ts32
union llvm::MachO::ppc_thread_state_t::@209 uts
S_ATTR_NO_DEAD_STRIP - No dead stripping.
S_REGULAR - Regular section.
S_ATTR_SOME_INSTRUCTIONS - Section contains some machine instructions.
S_INTERPOSING - Section with only pairs of function pointers for interposing.
static void SET_LIBRARY_ORDINAL(uint16_t &n_desc, uint8_t ordinal)
static uint8_t GET_COMM_ALIGN(uint16_t n_desc)
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
S_LITERAL_POINTERS - Section with pointers to literals.
S_GB_ZEROFILL - Zero fill on demand section (that can be larger than 4 gigabytes).
S_ATTR_EXT_RELOC - Section has external relocation entries.
S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
const uint32_t x86_THREAD_STATE64_COUNT
uint64_t objc_module_info_addr
S_THREAD_LOCAL_REGULAR - Thread local data section.
S_CSTRING_LITERALS - Section with literal C strings.
static uint16_t GET_LIBRARY_ORDINAL(uint16_t n_desc)
x86_exception_state64_t es64
static int CPU_SUBTYPE_INTEL(int Family, int Model)
union llvm::MachO::x86_float_state_t::@206 ufs
union llvm::MachO::arm_thread_state_t::@208 uts
S_LAZY_SYMBOL_POINTERS - Section with lazy symbol pointers.
S_DTRACE_DOF - Section contains DTrace Object Format.
static void SET_COMM_ALIGN(uint16_t &n_desc, uint8_t align)
const uint32_t x86_FLOAT_STATE64_COUNT
x86_thread_state64_t ts64
S_THREAD_LOCAL_VARIABLE_POINTERS - Section with pointers to thread local structures.
const uint32_t x86_THREAD_STATE_COUNT
S_THREAD_LOCAL_INIT_FUNCTION_POINTERS - Section with thread local variable initialization pointers to...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
S_16BYTE_LITERALS - Section with only 16 byte literals.
const uint32_t x86_EXCEPTION_STATE_COUNT
uint32_t objc_module_info_size
static int CPU_SUBTYPE_INTEL_MODEL(CPUSubTypeX86 ST)
static int CPU_SUBTYPE_INTEL_FAMILY(CPUSubTypeX86 ST)
S_COALESCED - Section contains symbols that are to be coalesced.
uint32_t objc_module_info_size
const uint32_t ARM_THREAD_STATE64_COUNT
union llvm::MachO::x86_thread_state_t::@205 uts
union llvm::MachO::x86_exception_state_t::@207 ues
S_ZEROFILL - Zero fill on demand section.
S_MOD_INIT_FUNC_POINTERS - Section with only function pointers for initialization.
SectionType
These are the section type and attributes fields.
uint32_t compatibility_version
const uint32_t PPC_THREAD_STATE_COUNT
arm_thread_state32_t ts32