Lines Matching refs:MachO

236   case MachO::DICE_KIND_DATA:  in DumpDataInCode()
256 if (Kind == MachO::DICE_KIND_DATA) in DumpDataInCode()
261 case MachO::DICE_KIND_JUMP_TABLE8: in DumpDataInCode()
268 case MachO::DICE_KIND_JUMP_TABLE16: in DumpDataInCode()
276 case MachO::DICE_KIND_JUMP_TABLE32: in DumpDataInCode()
277 case MachO::DICE_KIND_ABS_JUMP_TABLE32: in DumpDataInCode()
282 if (Kind == MachO::DICE_KIND_JUMP_TABLE32) in DumpDataInCode()
308 if (Command.C.cmd == MachO::LC_FUNCTION_STARTS) { in getSectionsAndSymbols()
311 MachO::linkedit_data_command LLC = in getSectionsAndSymbols()
315 } else if (Command.C.cmd == MachO::LC_SEGMENT) { in getSectionsAndSymbols()
316 MachO::segment_command SLC = MachOObj->getSegmentLoadCommand(Command); in getSectionsAndSymbols()
322 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in getSectionsAndSymbols()
323 MachO::segment_command_64 SLC = MachOObj->getSegment64LoadCommand(Command); in getSectionsAndSymbols()
348 if ((Kind == MachO::DICE_KIND_JUMP_TABLE8) && in DumpAndSkipDataInCode()
357 const MachO::any_relocation_info &RE, in printRelocationTargetName()
394 if (O->getAnyRelocationType(RE) == MachO::ARM64_RELOC_ADDEND && in printRelocationTargetName()
433 MachO::any_relocation_info RE = Obj->getRelocation(Rel); in getMachORelocationValueString()
448 case MachO::X86_64_RELOC_GOT_LOAD: in getMachORelocationValueString()
449 case MachO::X86_64_RELOC_GOT: { in getMachORelocationValueString()
456 case MachO::X86_64_RELOC_SUBTRACTOR: { in getMachORelocationValueString()
459 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
465 if (RType != MachO::X86_64_RELOC_UNSIGNED) in getMachORelocationValueString()
476 case MachO::X86_64_RELOC_TLV: in getMachORelocationValueString()
482 case MachO::X86_64_RELOC_SIGNED_1: in getMachORelocationValueString()
486 case MachO::X86_64_RELOC_SIGNED_2: in getMachORelocationValueString()
490 case MachO::X86_64_RELOC_SIGNED_4: in getMachORelocationValueString()
503 case MachO::GENERIC_RELOC_PAIR: // prints no info in getMachORelocationValueString()
505 case MachO::GENERIC_RELOC_SECTDIFF: { in getMachORelocationValueString()
508 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
514 if (RType != MachO::GENERIC_RELOC_PAIR) in getMachORelocationValueString()
527 case MachO::GENERIC_RELOC_LOCAL_SECTDIFF: { in getMachORelocationValueString()
530 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
535 if (RType != MachO::GENERIC_RELOC_PAIR) in getMachORelocationValueString()
544 case MachO::GENERIC_RELOC_TLV: { in getMachORelocationValueString()
556 case MachO::ARM_RELOC_HALF: in getMachORelocationValueString()
557 case MachO::ARM_RELOC_HALF_SECTDIFF: { in getMachORelocationValueString()
570 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
575 if (RType != MachO::ARM_RELOC_PAIR) in getMachORelocationValueString()
586 if (Type == MachO::ARM_RELOC_HALF_SECTDIFF) { in getMachORelocationValueString()
610 MachO::dysymtab_command Dysymtab = O->getDysymtabLoadCommand(); in PrintIndirectSymbolTable()
620 if (cputype & MachO::CPU_ARCH_ABI64) in PrintIndirectSymbolTable()
629 if (cputype & MachO::CPU_ARCH_ABI64) in PrintIndirectSymbolTable()
633 MachO::dysymtab_command Dysymtab = O->getDysymtabLoadCommand(); in PrintIndirectSymbolTable()
635 if (indirect_symbol == MachO::INDIRECT_SYMBOL_LOCAL) { in PrintIndirectSymbolTable()
640 (MachO::INDIRECT_SYMBOL_LOCAL | MachO::INDIRECT_SYMBOL_ABS)) { in PrintIndirectSymbolTable()
644 if (indirect_symbol == MachO::INDIRECT_SYMBOL_ABS) { in PrintIndirectSymbolTable()
650 MachO::symtab_command Symtab = O->getSymtabLoadCommand(); in PrintIndirectSymbolTable()
665 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in PrintIndirectSymbols()
666 MachO::segment_command_64 Seg = O->getSegment64LoadCommand(Load); in PrintIndirectSymbols()
668 MachO::section_64 Sec = O->getSection64(Load, J); in PrintIndirectSymbols()
669 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in PrintIndirectSymbols()
670 if (section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
671 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
672 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in PrintIndirectSymbols()
673 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in PrintIndirectSymbols()
674 section_type == MachO::S_SYMBOL_STUBS) { in PrintIndirectSymbols()
676 if (section_type == MachO::S_SYMBOL_STUBS) in PrintIndirectSymbols()
693 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in PrintIndirectSymbols()
694 MachO::segment_command Seg = O->getSegmentLoadCommand(Load); in PrintIndirectSymbols()
696 MachO::section Sec = O->getSection(Load, J); in PrintIndirectSymbols()
697 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in PrintIndirectSymbols()
698 if (section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
699 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
700 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in PrintIndirectSymbols()
701 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in PrintIndirectSymbols()
702 section_type == MachO::S_SYMBOL_STUBS) { in PrintIndirectSymbols()
704 if (section_type == MachO::S_SYMBOL_STUBS) in PrintIndirectSymbols()
752 case MachO::CPU_TYPE_I386: in PrintRType()
755 case MachO::CPU_TYPE_X86_64: in PrintRType()
758 case MachO::CPU_TYPE_ARM: in PrintRType()
761 case MachO::CPU_TYPE_ARM64: in PrintRType()
762 case MachO::CPU_TYPE_ARM64_32: in PrintRType()
772 if (cputype == MachO::CPU_TYPE_ARM && in PrintRLength()
773 (r_type == MachO::ARM_RELOC_HALF || in PrintRLength()
774 r_type == MachO::ARM_RELOC_HALF_SECTDIFF || previous_arm_half == true)) { in PrintRLength()
795 if (cputype == MachO::CPU_TYPE_X86_64) in PrintRLength()
811 const MachO::symtab_command Symtab = O->getSymtabLoadCommand(); in PrintRelocationEntries()
818 const MachO::any_relocation_info RE = O->getRelocation(Rel); in PrintRelocationEntries()
831 if (r_scattered && cputype != MachO::CPU_TYPE_X86_64) { in PrintRelocationEntries()
834 if ((cputype == MachO::CPU_TYPE_I386 && in PrintRelocationEntries()
835 r_type == MachO::GENERIC_RELOC_PAIR) || in PrintRelocationEntries()
836 (cputype == MachO::CPU_TYPE_ARM && r_type == MachO::ARM_RELOC_PAIR)) in PrintRelocationEntries()
857 if ((cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
858 r_type == MachO::ARM_RELOC_PAIR)) in PrintRelocationEntries()
860 } else if (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
861 sectdiff_r_type == MachO::ARM_RELOC_HALF_SECTDIFF) in PrintRelocationEntries()
863 if ((cputype == MachO::CPU_TYPE_I386 && in PrintRelocationEntries()
864 (r_type == MachO::GENERIC_RELOC_SECTDIFF || in PrintRelocationEntries()
865 r_type == MachO::GENERIC_RELOC_LOCAL_SECTDIFF)) || in PrintRelocationEntries()
866 (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
867 (sectdiff_r_type == MachO::ARM_RELOC_SECTDIFF || in PrintRelocationEntries()
868 sectdiff_r_type == MachO::ARM_RELOC_LOCAL_SECTDIFF || in PrintRelocationEntries()
869 sectdiff_r_type == MachO::ARM_RELOC_HALF_SECTDIFF))) { in PrintRelocationEntries()
876 if (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
877 (r_type == MachO::ARM_RELOC_HALF || in PrintRelocationEntries()
878 r_type == MachO::ARM_RELOC_HALF_SECTDIFF)) in PrintRelocationEntries()
894 if (cputype == MachO::CPU_TYPE_ARM && r_type == MachO::ARM_RELOC_PAIR) in PrintRelocationEntries()
936 if (cputype == MachO::CPU_TYPE_ARM && r_type == MachO::ARM_RELOC_PAIR) in PrintRelocationEntries()
938 else if ((cputype == MachO::CPU_TYPE_ARM64 || in PrintRelocationEntries()
939 cputype == MachO::CPU_TYPE_ARM64_32) && in PrintRelocationEntries()
940 r_type == MachO::ARM64_RELOC_ADDEND) in PrintRelocationEntries()
944 if (r_symbolnum == MachO::R_ABS) in PrintRelocationEntries()
964 if (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
965 (r_type == MachO::ARM_RELOC_HALF || in PrintRelocationEntries()
966 r_type == MachO::ARM_RELOC_HALF_SECTDIFF)) in PrintRelocationEntries()
983 const MachO::dysymtab_command Dysymtab = O->getDysymtabLoadCommand(); in PrintRelocations()
1001 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in PrintRelocations()
1002 const MachO::segment_command_64 Seg = O->getSegment64LoadCommand(Load); in PrintRelocations()
1004 const MachO::section_64 Sec = O->getSection64(Load, J); in PrintRelocations()
1021 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in PrintRelocations()
1022 const MachO::segment_command Seg = O->getSegmentLoadCommand(Load); in PrintRelocations()
1024 const MachO::section Sec = O->getSection(Load, J); in PrintRelocations()
1048 if (Command.C.cmd == MachO::LC_SEGMENT) { in PrintFunctionStarts()
1049 MachO::segment_command SLC = O->getSegmentLoadCommand(Command); in PrintFunctionStarts()
1054 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in PrintFunctionStarts()
1055 MachO::segment_command_64 SLC = O->getSegment64LoadCommand(Command); in PrintFunctionStarts()
1065 if (LC.C.cmd == MachO::LC_FUNCTION_STARTS) { in PrintFunctionStarts()
1066 MachO::linkedit_data_command FunctionStartsLC = in PrintFunctionStarts()
1083 MachO::linkedit_data_command DIC = O->getDataInCodeLoadCommand(); in PrintDataInCodeTable()
1084 uint32_t nentries = DIC.datasize / sizeof(struct MachO::data_in_code_entry); in PrintDataInCodeTable()
1099 case MachO::DICE_KIND_DATA: in PrintDataInCodeTable()
1102 case MachO::DICE_KIND_JUMP_TABLE8: in PrintDataInCodeTable()
1105 case MachO::DICE_KIND_JUMP_TABLE16: in PrintDataInCodeTable()
1108 case MachO::DICE_KIND_JUMP_TABLE32: in PrintDataInCodeTable()
1111 case MachO::DICE_KIND_ABS_JUMP_TABLE32: in PrintDataInCodeTable()
1125 MachO::linkedit_data_command LohLC = O->getLinkOptHintsLoadCommand(); in PrintLinkOptHints()
1184 if ((JustId && Load.C.cmd == MachO::LC_ID_DYLIB) || in PrintDylibs()
1185 (!JustId && (Load.C.cmd == MachO::LC_ID_DYLIB || in PrintDylibs()
1186 Load.C.cmd == MachO::LC_LOAD_DYLIB || in PrintDylibs()
1187 Load.C.cmd == MachO::LC_LOAD_WEAK_DYLIB || in PrintDylibs()
1188 Load.C.cmd == MachO::LC_REEXPORT_DYLIB || in PrintDylibs()
1189 Load.C.cmd == MachO::LC_LAZY_LOAD_DYLIB || in PrintDylibs()
1190 Load.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB))) { in PrintDylibs()
1191 MachO::dylib_command dl = O->getDylibIDLoadCommand(Load); in PrintDylibs()
1206 if (Load.C.cmd == MachO::LC_LOAD_WEAK_DYLIB) in PrintDylibs()
1208 if (Load.C.cmd == MachO::LC_REEXPORT_DYLIB) in PrintDylibs()
1210 if (Load.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB) in PrintDylibs()
1212 if (Load.C.cmd == MachO::LC_LAZY_LOAD_DYLIB) in PrintDylibs()
1218 if (Load.C.cmd == MachO::LC_ID_DYLIB) in PrintDylibs()
1220 else if (Load.C.cmd == MachO::LC_LOAD_DYLIB) in PrintDylibs()
1222 else if (Load.C.cmd == MachO::LC_LOAD_WEAK_DYLIB) in PrintDylibs()
1224 else if (Load.C.cmd == MachO::LC_LAZY_LOAD_DYLIB) in PrintDylibs()
1226 else if (Load.C.cmd == MachO::LC_REEXPORT_DYLIB) in PrintDylibs()
1228 else if (Load.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB) in PrintDylibs()
1240 if (Command.C.cmd == MachO::LC_RPATH) { in printRpaths()
1432 const MachO::section_64 Sec = O->getSection64(Ref); in DumpLiteralPointerSection()
1433 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1435 const MachO::section Sec = O->getSection(Ref); in DumpLiteralPointerSection()
1436 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1438 if (section_type == MachO::S_CSTRING_LITERALS || in DumpLiteralPointerSection()
1439 section_type == MachO::S_4BYTE_LITERALS || in DumpLiteralPointerSection()
1440 section_type == MachO::S_8BYTE_LITERALS || in DumpLiteralPointerSection()
1441 section_type == MachO::S_16BYTE_LITERALS) in DumpLiteralPointerSection()
1452 MachO::any_relocation_info RE; in DumpLiteralPointerSection()
1522 const MachO::section_64 Sec = O->getSection64(Ref); in DumpLiteralPointerSection()
1523 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1525 const MachO::section Sec = O->getSection(Ref); in DumpLiteralPointerSection()
1526 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1534 case MachO::S_CSTRING_LITERALS: in DumpLiteralPointerSection()
1541 case MachO::S_4BYTE_LITERALS: in DumpLiteralPointerSection()
1552 case MachO::S_8BYTE_LITERALS: { in DumpLiteralPointerSection()
1567 case MachO::S_16BYTE_LITERALS: { in DumpLiteralPointerSection()
1602 MachO::any_relocation_info RE; in DumpInitTermPointerSection()
1656 if (cputype == MachO::CPU_TYPE_I386 || cputype == MachO::CPU_TYPE_X86_64) { in DumpRawSectionContents()
1743 const MachO::section_64 Sec = O->getSection64(Ref); in DumpSectionContents()
1747 const MachO::section Sec = O->getSection(Ref); in DumpSectionContents()
1750 uint32_t section_type = section_flags & MachO::SECTION_TYPE; in DumpSectionContents()
1763 if ((section_flags & MachO::S_ATTR_PURE_INSTRUCTIONS) || in DumpSectionContents()
1764 (section_flags & MachO::S_ATTR_SOME_INSTRUCTIONS)) { in DumpSectionContents()
1784 case MachO::S_REGULAR: in DumpSectionContents()
1787 case MachO::S_ZEROFILL: in DumpSectionContents()
1790 case MachO::S_CSTRING_LITERALS: in DumpSectionContents()
1793 case MachO::S_4BYTE_LITERALS: in DumpSectionContents()
1796 case MachO::S_8BYTE_LITERALS: in DumpSectionContents()
1799 case MachO::S_16BYTE_LITERALS: in DumpSectionContents()
1802 case MachO::S_LITERAL_POINTERS: in DumpSectionContents()
1806 case MachO::S_MOD_INIT_FUNC_POINTERS: in DumpSectionContents()
1807 case MachO::S_MOD_TERM_FUNC_POINTERS: in DumpSectionContents()
1818 if (section_type == MachO::S_ZEROFILL) in DumpSectionContents()
1858 auto *MachO = dyn_cast<MachOObjectFile>(O); in checkMachOAndArchFlags() local
1860 if (!MachO || ArchAll || ArchFlags.empty()) in checkMachOAndArchFlags()
1863 MachO::mach_header H; in checkMachOAndArchFlags()
1864 MachO::mach_header_64 H_64; in checkMachOAndArchFlags()
1867 if (MachO->is64Bit()) { in checkMachOAndArchFlags()
1868 H_64 = MachO->MachOObjectFile::getHeader64(); in checkMachOAndArchFlags()
1872 H = MachO->MachOObjectFile::getHeader(); in checkMachOAndArchFlags()
1945 if (MachOOF->getHeader().filetype == MachO::MH_KEXT_BUNDLE && in ProcessMachO()
1946 MachOOF->getHeader().cputype == MachO::CPU_TYPE_ARM64) in ProcessMachO()
2017 case MachO::CPU_TYPE_I386: in printCPUType()
2019 case MachO::CPU_SUBTYPE_I386_ALL: in printCPUType()
2028 case MachO::CPU_TYPE_X86_64: in printCPUType()
2030 case MachO::CPU_SUBTYPE_X86_64_ALL: in printCPUType()
2034 case MachO::CPU_SUBTYPE_X86_64_H: in printCPUType()
2043 case MachO::CPU_TYPE_ARM: in printCPUType()
2045 case MachO::CPU_SUBTYPE_ARM_ALL: in printCPUType()
2049 case MachO::CPU_SUBTYPE_ARM_V4T: in printCPUType()
2053 case MachO::CPU_SUBTYPE_ARM_V5TEJ: in printCPUType()
2057 case MachO::CPU_SUBTYPE_ARM_XSCALE: in printCPUType()
2061 case MachO::CPU_SUBTYPE_ARM_V6: in printCPUType()
2065 case MachO::CPU_SUBTYPE_ARM_V6M: in printCPUType()
2069 case MachO::CPU_SUBTYPE_ARM_V7: in printCPUType()
2073 case MachO::CPU_SUBTYPE_ARM_V7EM: in printCPUType()
2077 case MachO::CPU_SUBTYPE_ARM_V7K: in printCPUType()
2081 case MachO::CPU_SUBTYPE_ARM_V7M: in printCPUType()
2085 case MachO::CPU_SUBTYPE_ARM_V7S: in printCPUType()
2094 case MachO::CPU_TYPE_ARM64: in printCPUType()
2095 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in printCPUType()
2096 case MachO::CPU_SUBTYPE_ARM64_ALL: in printCPUType()
2100 case MachO::CPU_SUBTYPE_ARM64_V8: in printCPUType()
2104 case MachO::CPU_SUBTYPE_ARM64E: in printCPUType()
2113 case MachO::CPU_TYPE_ARM64_32: in printCPUType()
2114 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in printCPUType()
2115 case MachO::CPU_SUBTYPE_ARM64_32_V8: in printCPUType()
2134 if (UB->getMagic() == MachO::FAT_MAGIC) in printMachOUniversalHeaders()
2139 outs() << "fat_magic " << format("0x%" PRIx32, MachO::FAT_MAGIC) << "\n"; in printMachOUniversalHeaders()
2144 uint64_t big_size = sizeof(struct MachO::fat_header) + in printMachOUniversalHeaders()
2145 nfat_arch * sizeof(struct MachO::fat_arch); in printMachOUniversalHeaders()
2164 (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) == in printMachOUniversalHeaders()
2165 (other_cpusubtype & ~MachO::CPU_SUBTYPE_MASK)) { in printMachOUniversalHeaders()
2172 printCPUType(cputype, cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in printMachOUniversalHeaders()
2176 outs() << " cpusubtype " << (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) in printMachOUniversalHeaders()
2180 (cpusubtype & MachO::CPU_SUBTYPE_MASK) == MachO::CPU_SUBTYPE_LIB64) in printMachOUniversalHeaders()
2185 (cpusubtype & MachO::CPU_SUBTYPE_MASK) >> 24) << "\n"; in printMachOUniversalHeaders()
2608 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
2621 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2635 if (r_type == MachO::GENERIC_RELOC_SECTDIFF || in SymbolizerGetOpInfo()
2636 r_type == MachO::GENERIC_RELOC_LOCAL_SECTDIFF) { in SymbolizerGetOpInfo()
2639 MachO::any_relocation_info RENext; in SymbolizerGetOpInfo()
2665 if (reloc_found && (r_type == MachO::GENERIC_RELOC_SECTDIFF || in SymbolizerGetOpInfo()
2666 r_type == MachO::GENERIC_RELOC_LOCAL_SECTDIFF)) { in SymbolizerGetOpInfo()
2691 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
2695 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2733 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2760 if (Type == MachO::X86_64_RELOC_SUBTRACTOR) { in SymbolizerGetOpInfo()
2763 MachO::any_relocation_info RENext = info->O->getRelocation(RelNext); in SymbolizerGetOpInfo()
2767 if (TypeNext == MachO::X86_64_RELOC_UNSIGNED && isExternNext) { in SymbolizerGetOpInfo()
2786 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
2798 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2827 if (r_type == MachO::ARM_RELOC_HALF || in SymbolizerGetOpInfo()
2828 r_type == MachO::ARM_RELOC_SECTDIFF || in SymbolizerGetOpInfo()
2829 r_type == MachO::ARM_RELOC_LOCAL_SECTDIFF || in SymbolizerGetOpInfo()
2830 r_type == MachO::ARM_RELOC_HALF_SECTDIFF) { in SymbolizerGetOpInfo()
2833 MachO::any_relocation_info RENext; in SymbolizerGetOpInfo()
2846 case MachO::ARM_RELOC_HALF: in SymbolizerGetOpInfo()
2864 if (isExtern == 0 && (r_type == MachO::ARM_RELOC_BR24 || in SymbolizerGetOpInfo()
2865 r_type == MachO::ARM_THUMB_RELOC_BR22)) in SymbolizerGetOpInfo()
2869 if (r_type == MachO::ARM_RELOC_HALF || in SymbolizerGetOpInfo()
2870 r_type == MachO::ARM_RELOC_HALF_SECTDIFF) { in SymbolizerGetOpInfo()
2876 if (r_scattered && (r_type != MachO::ARM_RELOC_HALF && in SymbolizerGetOpInfo()
2877 r_type != MachO::ARM_RELOC_HALF_SECTDIFF)) { in SymbolizerGetOpInfo()
2882 if (r_type == MachO::ARM_RELOC_HALF_SECTDIFF) { in SymbolizerGetOpInfo()
2906 if (r_type == MachO::ARM_RELOC_HALF) { in SymbolizerGetOpInfo()
2923 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
2944 MachO::any_relocation_info RE = info->O->getRelocation(Rel); in SymbolizerGetOpInfo()
2946 if (r_type == MachO::ARM64_RELOC_ADDEND) { in SymbolizerGetOpInfo()
2949 MachO::any_relocation_info RENext = info->O->getRelocation(RelNext); in SymbolizerGetOpInfo()
2965 case MachO::ARM64_RELOC_PAGE21: in SymbolizerGetOpInfo()
2969 case MachO::ARM64_RELOC_PAGEOFF12: in SymbolizerGetOpInfo()
2973 case MachO::ARM64_RELOC_GOT_LOAD_PAGE21: in SymbolizerGetOpInfo()
2977 case MachO::ARM64_RELOC_GOT_LOAD_PAGEOFF12: in SymbolizerGetOpInfo()
2981 case MachO::ARM64_RELOC_TLVP_LOAD_PAGE21: in SymbolizerGetOpInfo()
2985 case MachO::ARM64_RELOC_TLVP_LOAD_PAGEOFF12: in SymbolizerGetOpInfo()
2990 case MachO::ARM64_RELOC_BRANCH26: in SymbolizerGetOpInfo()
3005 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in GuessCstringPointer()
3006 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load); in GuessCstringPointer()
3008 MachO::section_64 Sec = info->O->getSection64(Load, J); in GuessCstringPointer()
3009 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessCstringPointer()
3010 if (section_type == MachO::S_CSTRING_LITERALS && in GuessCstringPointer()
3026 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in GuessCstringPointer()
3027 MachO::segment_command Seg = info->O->getSegmentLoadCommand(Load); in GuessCstringPointer()
3029 MachO::section Sec = info->O->getSection(Load, J); in GuessCstringPointer()
3030 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessCstringPointer()
3031 if (section_type == MachO::S_CSTRING_LITERALS && in GuessCstringPointer()
3058 MachO::dysymtab_command Dysymtab = info->O->getDysymtabLoadCommand(); in GuessIndirectSymbol()
3059 MachO::symtab_command Symtab = info->O->getSymtabLoadCommand(); in GuessIndirectSymbol()
3061 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in GuessIndirectSymbol()
3062 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load); in GuessIndirectSymbol()
3064 MachO::section_64 Sec = info->O->getSection64(Load, J); in GuessIndirectSymbol()
3065 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessIndirectSymbol()
3066 if ((section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3067 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3068 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in GuessIndirectSymbol()
3069 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in GuessIndirectSymbol()
3070 section_type == MachO::S_SYMBOL_STUBS) && in GuessIndirectSymbol()
3074 if (section_type == MachO::S_SYMBOL_STUBS) in GuessIndirectSymbol()
3092 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in GuessIndirectSymbol()
3093 MachO::segment_command Seg = info->O->getSegmentLoadCommand(Load); in GuessIndirectSymbol()
3095 MachO::section Sec = info->O->getSection(Load, J); in GuessIndirectSymbol()
3096 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessIndirectSymbol()
3097 if ((section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3098 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3099 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in GuessIndirectSymbol()
3100 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in GuessIndirectSymbol()
3101 section_type == MachO::S_SYMBOL_STUBS) && in GuessIndirectSymbol()
3105 if (section_type == MachO::S_SYMBOL_STUBS) in GuessIndirectSymbol()
3212 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in GuessPointerPointer()
3213 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load); in GuessPointerPointer()
3215 MachO::section_64 Sec = info->O->getSection64(Load, J); in GuessPointerPointer()
3325 MachO::any_relocation_info RE; in get_symbol_64()
6832 MachO::mach_header H; in printObjcMetaData()
6834 if (H.cputype == MachO::CPU_TYPE_ARM) in printObjcMetaData()
6871 if (info->O->getHeader().filetype == MachO::MH_OBJECT) { in GuessLiteralPointer()
6876 MachO::any_relocation_info RE; in GuessLiteralPointer()
6900 if (Type == MachO::X86_64_RELOC_SIGNED) { in GuessLiteralPointer()
7306 MachO::mach_header Header = MachOOF->getHeader(); in DisassembleMachO()
7325 if (Header.filetype == MachO::MH_OBJECT) in DisassembleMachO()
7397 const MachO::mach_header_64 H_64 = MachOOF->getHeader64(); in DisassembleMachO()
7401 const MachO::mach_header H = MachOOF->getHeader(); in DisassembleMachO()
8257 if (magic == MachO::MH_MAGIC) in PrintMachHeader()
8259 else if (magic == MachO::MH_MAGIC_64) in PrintMachHeader()
8264 case MachO::CPU_TYPE_I386: in PrintMachHeader()
8266 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8267 case MachO::CPU_SUBTYPE_I386_ALL: in PrintMachHeader()
8271 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8275 case MachO::CPU_TYPE_X86_64: in PrintMachHeader()
8277 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8278 case MachO::CPU_SUBTYPE_X86_64_ALL: in PrintMachHeader()
8281 case MachO::CPU_SUBTYPE_X86_64_H: in PrintMachHeader()
8285 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8289 case MachO::CPU_TYPE_ARM: in PrintMachHeader()
8291 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8292 case MachO::CPU_SUBTYPE_ARM_ALL: in PrintMachHeader()
8295 case MachO::CPU_SUBTYPE_ARM_V4T: in PrintMachHeader()
8298 case MachO::CPU_SUBTYPE_ARM_V5TEJ: in PrintMachHeader()
8301 case MachO::CPU_SUBTYPE_ARM_XSCALE: in PrintMachHeader()
8304 case MachO::CPU_SUBTYPE_ARM_V6: in PrintMachHeader()
8307 case MachO::CPU_SUBTYPE_ARM_V6M: in PrintMachHeader()
8310 case MachO::CPU_SUBTYPE_ARM_V7: in PrintMachHeader()
8313 case MachO::CPU_SUBTYPE_ARM_V7EM: in PrintMachHeader()
8316 case MachO::CPU_SUBTYPE_ARM_V7K: in PrintMachHeader()
8319 case MachO::CPU_SUBTYPE_ARM_V7M: in PrintMachHeader()
8322 case MachO::CPU_SUBTYPE_ARM_V7S: in PrintMachHeader()
8326 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8330 case MachO::CPU_TYPE_ARM64: in PrintMachHeader()
8332 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8333 case MachO::CPU_SUBTYPE_ARM64_ALL: in PrintMachHeader()
8336 case MachO::CPU_SUBTYPE_ARM64_V8: in PrintMachHeader()
8339 case MachO::CPU_SUBTYPE_ARM64E: in PrintMachHeader()
8343 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8347 case MachO::CPU_TYPE_ARM64_32: in PrintMachHeader()
8349 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8350 case MachO::CPU_SUBTYPE_ARM64_32_V8: in PrintMachHeader()
8354 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8358 case MachO::CPU_TYPE_POWERPC: in PrintMachHeader()
8360 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8361 case MachO::CPU_SUBTYPE_POWERPC_ALL: in PrintMachHeader()
8365 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8369 case MachO::CPU_TYPE_POWERPC64: in PrintMachHeader()
8371 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8372 case MachO::CPU_SUBTYPE_POWERPC_ALL: in PrintMachHeader()
8376 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8382 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8385 if ((cpusubtype & MachO::CPU_SUBTYPE_MASK) == MachO::CPU_SUBTYPE_LIB64) { in PrintMachHeader()
8389 (cpusubtype & MachO::CPU_SUBTYPE_MASK) >> 24); in PrintMachHeader()
8392 case MachO::MH_OBJECT: in PrintMachHeader()
8395 case MachO::MH_EXECUTE: in PrintMachHeader()
8398 case MachO::MH_FVMLIB: in PrintMachHeader()
8401 case MachO::MH_CORE: in PrintMachHeader()
8404 case MachO::MH_PRELOAD: in PrintMachHeader()
8407 case MachO::MH_DYLIB: in PrintMachHeader()
8410 case MachO::MH_DYLIB_STUB: in PrintMachHeader()
8413 case MachO::MH_DYLINKER: in PrintMachHeader()
8416 case MachO::MH_BUNDLE: in PrintMachHeader()
8419 case MachO::MH_DSYM: in PrintMachHeader()
8422 case MachO::MH_KEXT_BUNDLE: in PrintMachHeader()
8432 if (f & MachO::MH_NOUNDEFS) { in PrintMachHeader()
8434 f &= ~MachO::MH_NOUNDEFS; in PrintMachHeader()
8436 if (f & MachO::MH_INCRLINK) { in PrintMachHeader()
8438 f &= ~MachO::MH_INCRLINK; in PrintMachHeader()
8440 if (f & MachO::MH_DYLDLINK) { in PrintMachHeader()
8442 f &= ~MachO::MH_DYLDLINK; in PrintMachHeader()
8444 if (f & MachO::MH_BINDATLOAD) { in PrintMachHeader()
8446 f &= ~MachO::MH_BINDATLOAD; in PrintMachHeader()
8448 if (f & MachO::MH_PREBOUND) { in PrintMachHeader()
8450 f &= ~MachO::MH_PREBOUND; in PrintMachHeader()
8452 if (f & MachO::MH_SPLIT_SEGS) { in PrintMachHeader()
8454 f &= ~MachO::MH_SPLIT_SEGS; in PrintMachHeader()
8456 if (f & MachO::MH_LAZY_INIT) { in PrintMachHeader()
8458 f &= ~MachO::MH_LAZY_INIT; in PrintMachHeader()
8460 if (f & MachO::MH_TWOLEVEL) { in PrintMachHeader()
8462 f &= ~MachO::MH_TWOLEVEL; in PrintMachHeader()
8464 if (f & MachO::MH_FORCE_FLAT) { in PrintMachHeader()
8466 f &= ~MachO::MH_FORCE_FLAT; in PrintMachHeader()
8468 if (f & MachO::MH_NOMULTIDEFS) { in PrintMachHeader()
8470 f &= ~MachO::MH_NOMULTIDEFS; in PrintMachHeader()
8472 if (f & MachO::MH_NOFIXPREBINDING) { in PrintMachHeader()
8474 f &= ~MachO::MH_NOFIXPREBINDING; in PrintMachHeader()
8476 if (f & MachO::MH_PREBINDABLE) { in PrintMachHeader()
8478 f &= ~MachO::MH_PREBINDABLE; in PrintMachHeader()
8480 if (f & MachO::MH_ALLMODSBOUND) { in PrintMachHeader()
8482 f &= ~MachO::MH_ALLMODSBOUND; in PrintMachHeader()
8484 if (f & MachO::MH_SUBSECTIONS_VIA_SYMBOLS) { in PrintMachHeader()
8486 f &= ~MachO::MH_SUBSECTIONS_VIA_SYMBOLS; in PrintMachHeader()
8488 if (f & MachO::MH_CANONICAL) { in PrintMachHeader()
8490 f &= ~MachO::MH_CANONICAL; in PrintMachHeader()
8492 if (f & MachO::MH_WEAK_DEFINES) { in PrintMachHeader()
8494 f &= ~MachO::MH_WEAK_DEFINES; in PrintMachHeader()
8496 if (f & MachO::MH_BINDS_TO_WEAK) { in PrintMachHeader()
8498 f &= ~MachO::MH_BINDS_TO_WEAK; in PrintMachHeader()
8500 if (f & MachO::MH_ALLOW_STACK_EXECUTION) { in PrintMachHeader()
8502 f &= ~MachO::MH_ALLOW_STACK_EXECUTION; in PrintMachHeader()
8504 if (f & MachO::MH_DEAD_STRIPPABLE_DYLIB) { in PrintMachHeader()
8506 f &= ~MachO::MH_DEAD_STRIPPABLE_DYLIB; in PrintMachHeader()
8508 if (f & MachO::MH_PIE) { in PrintMachHeader()
8510 f &= ~MachO::MH_PIE; in PrintMachHeader()
8512 if (f & MachO::MH_NO_REEXPORTED_DYLIBS) { in PrintMachHeader()
8514 f &= ~MachO::MH_NO_REEXPORTED_DYLIBS; in PrintMachHeader()
8516 if (f & MachO::MH_HAS_TLV_DESCRIPTORS) { in PrintMachHeader()
8518 f &= ~MachO::MH_HAS_TLV_DESCRIPTORS; in PrintMachHeader()
8520 if (f & MachO::MH_NO_HEAP_EXECUTION) { in PrintMachHeader()
8522 f &= ~MachO::MH_NO_HEAP_EXECUTION; in PrintMachHeader()
8524 if (f & MachO::MH_APP_EXTENSION_SAFE) { in PrintMachHeader()
8526 f &= ~MachO::MH_APP_EXTENSION_SAFE; in PrintMachHeader()
8528 if (f & MachO::MH_NLIST_OUTOFSYNC_WITH_DYLDINFO) { in PrintMachHeader()
8530 f &= ~MachO::MH_NLIST_OUTOFSYNC_WITH_DYLDINFO; in PrintMachHeader()
8537 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8539 (cpusubtype & MachO::CPU_SUBTYPE_MASK) >> 24); in PrintMachHeader()
8556 if (cmd == MachO::LC_SEGMENT) { in PrintSegmentCommand()
8559 expected_cmdsize *= sizeof(struct MachO::section); in PrintSegmentCommand()
8560 expected_cmdsize += sizeof(struct MachO::segment_command); in PrintSegmentCommand()
8564 expected_cmdsize *= sizeof(struct MachO::section_64); in PrintSegmentCommand()
8565 expected_cmdsize += sizeof(struct MachO::segment_command_64); in PrintSegmentCommand()
8573 if (cmd == MachO::LC_SEGMENT_64) { in PrintSegmentCommand()
8592 ~(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | in PrintSegmentCommand()
8593 MachO::VM_PROT_EXECUTE)) != 0) in PrintSegmentCommand()
8597 outs() << ((maxprot & MachO::VM_PROT_READ) ? "r" : "-"); in PrintSegmentCommand()
8598 outs() << ((maxprot & MachO::VM_PROT_WRITE) ? "w" : "-"); in PrintSegmentCommand()
8599 outs() << ((maxprot & MachO::VM_PROT_EXECUTE) ? "x\n" : "-\n"); in PrintSegmentCommand()
8602 ~(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | in PrintSegmentCommand()
8603 MachO::VM_PROT_EXECUTE)) != 0) in PrintSegmentCommand()
8607 outs() << ((initprot & MachO::VM_PROT_READ) ? "r" : "-"); in PrintSegmentCommand()
8608 outs() << ((initprot & MachO::VM_PROT_WRITE) ? "w" : "-"); in PrintSegmentCommand()
8609 outs() << ((initprot & MachO::VM_PROT_EXECUTE) ? "x\n" : "-\n"); in PrintSegmentCommand()
8621 if (flags & MachO::SG_HIGHVM) { in PrintSegmentCommand()
8623 flags &= ~MachO::SG_HIGHVM; in PrintSegmentCommand()
8625 if (flags & MachO::SG_FVMLIB) { in PrintSegmentCommand()
8627 flags &= ~MachO::SG_FVMLIB; in PrintSegmentCommand()
8629 if (flags & MachO::SG_NORELOC) { in PrintSegmentCommand()
8631 flags &= ~MachO::SG_NORELOC; in PrintSegmentCommand()
8633 if (flags & MachO::SG_PROTECTED_VERSION_1) { in PrintSegmentCommand()
8635 flags &= ~MachO::SG_PROTECTED_VERSION_1; in PrintSegmentCommand()
8657 if (filetype != MachO::MH_OBJECT && strncmp(sg_segname, segname, 16) != 0) in PrintSection()
8661 if (cmd == MachO::LC_SEGMENT_64) { in PrintSection()
8668 if ((flags & MachO::S_ZEROFILL) != 0 && offset + size > object_size) in PrintSection()
8685 if (reloff + nreloc * sizeof(struct MachO::relocation_info) > object_size) in PrintSection()
8689 uint32_t section_type = flags & MachO::SECTION_TYPE; in PrintSection()
8692 if (section_type == MachO::S_REGULAR) in PrintSection()
8694 else if (section_type == MachO::S_ZEROFILL) in PrintSection()
8696 else if (section_type == MachO::S_CSTRING_LITERALS) in PrintSection()
8698 else if (section_type == MachO::S_4BYTE_LITERALS) in PrintSection()
8700 else if (section_type == MachO::S_8BYTE_LITERALS) in PrintSection()
8702 else if (section_type == MachO::S_16BYTE_LITERALS) in PrintSection()
8704 else if (section_type == MachO::S_LITERAL_POINTERS) in PrintSection()
8706 else if (section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS) in PrintSection()
8708 else if (section_type == MachO::S_LAZY_SYMBOL_POINTERS) in PrintSection()
8710 else if (section_type == MachO::S_SYMBOL_STUBS) in PrintSection()
8712 else if (section_type == MachO::S_MOD_INIT_FUNC_POINTERS) in PrintSection()
8714 else if (section_type == MachO::S_MOD_TERM_FUNC_POINTERS) in PrintSection()
8716 else if (section_type == MachO::S_COALESCED) in PrintSection()
8718 else if (section_type == MachO::S_INTERPOSING) in PrintSection()
8720 else if (section_type == MachO::S_DTRACE_DOF) in PrintSection()
8722 else if (section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS) in PrintSection()
8724 else if (section_type == MachO::S_THREAD_LOCAL_REGULAR) in PrintSection()
8726 else if (section_type == MachO::S_THREAD_LOCAL_ZEROFILL) in PrintSection()
8728 else if (section_type == MachO::S_THREAD_LOCAL_VARIABLES) in PrintSection()
8730 else if (section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS) in PrintSection()
8732 else if (section_type == MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS) in PrintSection()
8737 uint32_t section_attributes = flags & MachO::SECTION_ATTRIBUTES; in PrintSection()
8738 if (section_attributes & MachO::S_ATTR_PURE_INSTRUCTIONS) in PrintSection()
8740 if (section_attributes & MachO::S_ATTR_NO_TOC) in PrintSection()
8742 if (section_attributes & MachO::S_ATTR_STRIP_STATIC_SYMS) in PrintSection()
8744 if (section_attributes & MachO::S_ATTR_NO_DEAD_STRIP) in PrintSection()
8746 if (section_attributes & MachO::S_ATTR_LIVE_SUPPORT) in PrintSection()
8748 if (section_attributes & MachO::S_ATTR_SELF_MODIFYING_CODE) in PrintSection()
8750 if (section_attributes & MachO::S_ATTR_DEBUG) in PrintSection()
8752 if (section_attributes & MachO::S_ATTR_SOME_INSTRUCTIONS) in PrintSection()
8754 if (section_attributes & MachO::S_ATTR_EXT_RELOC) in PrintSection()
8756 if (section_attributes & MachO::S_ATTR_LOC_RELOC) in PrintSection()
8764 if (section_type == MachO::S_SYMBOL_STUBS || in PrintSection()
8765 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in PrintSection()
8766 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in PrintSection()
8767 section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in PrintSection()
8768 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS) in PrintSection()
8773 if (section_type == MachO::S_SYMBOL_STUBS) in PrintSection()
8779 static void PrintSymtabLoadCommand(MachO::symtab_command st, bool Is64Bit, in PrintSymtabLoadCommand()
8783 if (st.cmdsize != sizeof(struct MachO::symtab_command)) in PrintSymtabLoadCommand()
8796 big_size *= sizeof(struct MachO::nlist_64); in PrintSymtabLoadCommand()
8804 big_size *= sizeof(struct MachO::nlist); in PrintSymtabLoadCommand()
8825 static void PrintDysymtabLoadCommand(MachO::dysymtab_command dyst, in PrintDysymtabLoadCommand()
8830 if (dyst.cmdsize != sizeof(struct MachO::dysymtab_command)) in PrintDysymtabLoadCommand()
8878 big_size *= sizeof(struct MachO::dylib_table_of_contents); in PrintDysymtabLoadCommand()
8893 modtabend *= sizeof(struct MachO::dylib_module_64); in PrintDysymtabLoadCommand()
8897 modtabend *= sizeof(struct MachO::dylib_module); in PrintDysymtabLoadCommand()
8911 big_size *= sizeof(struct MachO::dylib_reference); in PrintDysymtabLoadCommand()
8937 big_size *= sizeof(struct MachO::relocation_info); in PrintDysymtabLoadCommand()
8950 big_size *= sizeof(struct MachO::relocation_info); in PrintDysymtabLoadCommand()
8958 static void PrintDyldInfoLoadCommand(MachO::dyld_info_command dc, in PrintDyldInfoLoadCommand()
8960 if (dc.cmd == MachO::LC_DYLD_INFO) in PrintDyldInfoLoadCommand()
8965 if (dc.cmdsize != sizeof(struct MachO::dyld_info_command)) in PrintDyldInfoLoadCommand()
9032 static void PrintDyldLoadCommand(MachO::dylinker_command dyld, in PrintDyldLoadCommand()
9034 if (dyld.cmd == MachO::LC_ID_DYLINKER) in PrintDyldLoadCommand()
9036 else if (dyld.cmd == MachO::LC_LOAD_DYLINKER) in PrintDyldLoadCommand()
9038 else if (dyld.cmd == MachO::LC_DYLD_ENVIRONMENT) in PrintDyldLoadCommand()
9043 if (dyld.cmdsize < sizeof(struct MachO::dylinker_command)) in PrintDyldLoadCommand()
9055 static void PrintUuidLoadCommand(MachO::uuid_command uuid) { in PrintUuidLoadCommand()
9058 if (uuid.cmdsize != sizeof(struct MachO::uuid_command)) in PrintUuidLoadCommand()
9071 static void PrintRpathLoadCommand(MachO::rpath_command rpath, const char *Ptr) { in PrintRpathLoadCommand()
9074 if (rpath.cmdsize < sizeof(struct MachO::rpath_command)) in PrintRpathLoadCommand()
9086 static void PrintVersionMinLoadCommand(MachO::version_min_command vd) { in PrintVersionMinLoadCommand()
9089 case MachO::LC_VERSION_MIN_MACOSX: in PrintVersionMinLoadCommand()
9092 case MachO::LC_VERSION_MIN_IPHONEOS: in PrintVersionMinLoadCommand()
9095 case MachO::LC_VERSION_MIN_TVOS: in PrintVersionMinLoadCommand()
9098 case MachO::LC_VERSION_MIN_WATCHOS: in PrintVersionMinLoadCommand()
9107 if (vd.cmdsize != sizeof(struct MachO::version_min_command)) in PrintVersionMinLoadCommand()
9131 static void PrintNoteLoadCommand(MachO::note_command Nt) { in PrintNoteLoadCommand()
9134 if (Nt.cmdsize != sizeof(struct MachO::note_command)) in PrintNoteLoadCommand()
9144 static void PrintBuildToolVersion(MachO::build_tool_version bv) { in PrintBuildToolVersion()
9151 MachO::build_version_command bd) { in PrintBuildVersionLoadCommand()
9155 sizeof(struct MachO::build_version_command) + in PrintBuildVersionLoadCommand()
9156 bd.ntools * sizeof(struct MachO::build_tool_version)) in PrintBuildVersionLoadCommand()
9171 MachO::build_tool_version bv = obj->getBuildToolVersion(i); in PrintBuildVersionLoadCommand()
9176 static void PrintSourceVersionCommand(MachO::source_version_command sd) { in PrintSourceVersionCommand()
9179 if (sd.cmdsize != sizeof(struct MachO::source_version_command)) in PrintSourceVersionCommand()
9198 static void PrintEntryPointCommand(MachO::entry_point_command ep) { in PrintEntryPointCommand()
9201 if (ep.cmdsize != sizeof(struct MachO::entry_point_command)) in PrintEntryPointCommand()
9209 static void PrintEncryptionInfoCommand(MachO::encryption_info_command ec, in PrintEncryptionInfoCommand()
9213 if (ec.cmdsize != sizeof(struct MachO::encryption_info_command)) in PrintEncryptionInfoCommand()
9230 static void PrintEncryptionInfoCommand64(MachO::encryption_info_command_64 ec, in PrintEncryptionInfoCommand64()
9234 if (ec.cmdsize != sizeof(struct MachO::encryption_info_command_64)) in PrintEncryptionInfoCommand64()
9252 static void PrintLinkerOptionCommand(MachO::linker_option_command lo, in PrintLinkerOptionCommand()
9256 if (lo.cmdsize < sizeof(struct MachO::linker_option_command)) in PrintLinkerOptionCommand()
9261 const char *string = Ptr + sizeof(struct MachO::linker_option_command); in PrintLinkerOptionCommand()
9262 uint32_t left = lo.cmdsize - sizeof(struct MachO::linker_option_command); in PrintLinkerOptionCommand()
9283 static void PrintSubFrameworkCommand(MachO::sub_framework_command sub, in PrintSubFrameworkCommand()
9287 if (sub.cmdsize < sizeof(struct MachO::sub_framework_command)) in PrintSubFrameworkCommand()
9299 static void PrintSubUmbrellaCommand(MachO::sub_umbrella_command sub, in PrintSubUmbrellaCommand()
9303 if (sub.cmdsize < sizeof(struct MachO::sub_umbrella_command)) in PrintSubUmbrellaCommand()
9315 static void PrintSubLibraryCommand(MachO::sub_library_command sub, in PrintSubLibraryCommand()
9319 if (sub.cmdsize < sizeof(struct MachO::sub_library_command)) in PrintSubLibraryCommand()
9331 static void PrintSubClientCommand(MachO::sub_client_command sub, in PrintSubClientCommand()
9335 if (sub.cmdsize < sizeof(struct MachO::sub_client_command)) in PrintSubClientCommand()
9347 static void PrintRoutinesCommand(MachO::routines_command r) { in PrintRoutinesCommand()
9350 if (r.cmdsize != sizeof(struct MachO::routines_command)) in PrintRoutinesCommand()
9364 static void PrintRoutinesCommand64(MachO::routines_command_64 r) { in PrintRoutinesCommand64()
9367 if (r.cmdsize != sizeof(struct MachO::routines_command_64)) in PrintRoutinesCommand64()
9381 static void Print_x86_thread_state32_t(MachO::x86_thread_state32_t &cpu32) { in Print_x86_thread_state32_t()
9400 static void Print_x86_thread_state64_t(MachO::x86_thread_state64_t &cpu64) { in Print_x86_thread_state64_t()
9424 static void Print_mmst_reg(MachO::mmst_reg_t &r) { in Print_mmst_reg()
9436 static void Print_xmm_reg(MachO::xmm_reg_t &r) { in Print_xmm_reg()
9444 static void Print_x86_float_state_t(MachO::x86_float_state64_t &fpu) { in Print_x86_float_state_t()
9454 if (fpu.fpu_fcw.pc == MachO::x86_FP_PREC_24B) in Print_x86_float_state_t()
9456 else if (fpu.fpu_fcw.pc == MachO::x86_FP_PREC_53B) in Print_x86_float_state_t()
9458 else if (fpu.fpu_fcw.pc == MachO::x86_FP_PREC_64B) in Print_x86_float_state_t()
9463 if (fpu.fpu_fcw.rc == MachO::x86_FP_RND_NEAR) in Print_x86_float_state_t()
9465 else if (fpu.fpu_fcw.rc == MachO::x86_FP_RND_DOWN) in Print_x86_float_state_t()
9467 else if (fpu.fpu_fcw.rc == MachO::x86_FP_RND_UP) in Print_x86_float_state_t()
9469 else if (fpu.fpu_fcw.rc == MachO::x86_FP_CHOP) in Print_x86_float_state_t()
9557 static void Print_x86_exception_state_t(MachO::x86_exception_state64_t &exc64) { in Print_x86_exception_state_t()
9563 static void Print_arm_thread_state32_t(MachO::arm_thread_state32_t &cpu32) { in Print_arm_thread_state32_t()
9583 static void Print_arm_thread_state64_t(MachO::arm_thread_state64_t &cpu64) { in Print_arm_thread_state64_t()
9620 static void PrintThreadCommand(MachO::thread_command t, const char *Ptr, in PrintThreadCommand()
9622 if (t.cmd == MachO::LC_THREAD) in PrintThreadCommand()
9624 else if (t.cmd == MachO::LC_UNIXTHREAD) in PrintThreadCommand()
9629 if (t.cmdsize < sizeof(struct MachO::thread_command) + 2 * sizeof(uint32_t)) in PrintThreadCommand()
9634 const char *begin = Ptr + sizeof(struct MachO::thread_command); in PrintThreadCommand()
9637 if (cputype == MachO::CPU_TYPE_I386) { in PrintThreadCommand()
9657 if (flavor == MachO::x86_THREAD_STATE32) { in PrintThreadCommand()
9659 if (count == MachO::x86_THREAD_STATE32_COUNT) in PrintThreadCommand()
9664 MachO::x86_thread_state32_t cpu32; in PrintThreadCommand()
9666 if (left >= sizeof(MachO::x86_thread_state32_t)) { in PrintThreadCommand()
9667 memcpy(&cpu32, begin, sizeof(MachO::x86_thread_state32_t)); in PrintThreadCommand()
9668 begin += sizeof(MachO::x86_thread_state32_t); in PrintThreadCommand()
9670 memset(&cpu32, '\0', sizeof(MachO::x86_thread_state32_t)); in PrintThreadCommand()
9677 } else if (flavor == MachO::x86_THREAD_STATE) { in PrintThreadCommand()
9679 if (count == MachO::x86_THREAD_STATE_COUNT) in PrintThreadCommand()
9684 struct MachO::x86_thread_state_t ts; in PrintThreadCommand()
9686 if (left >= sizeof(MachO::x86_thread_state_t)) { in PrintThreadCommand()
9687 memcpy(&ts, begin, sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9688 begin += sizeof(MachO::x86_thread_state_t); in PrintThreadCommand()
9690 memset(&ts, '\0', sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9696 if (ts.tsh.flavor == MachO::x86_THREAD_STATE32) { in PrintThreadCommand()
9698 if (ts.tsh.count == MachO::x86_THREAD_STATE32_COUNT) in PrintThreadCommand()
9715 } else if (cputype == MachO::CPU_TYPE_X86_64) { in PrintThreadCommand()
9735 if (flavor == MachO::x86_THREAD_STATE64) { in PrintThreadCommand()
9737 if (count == MachO::x86_THREAD_STATE64_COUNT) in PrintThreadCommand()
9742 MachO::x86_thread_state64_t cpu64; in PrintThreadCommand()
9744 if (left >= sizeof(MachO::x86_thread_state64_t)) { in PrintThreadCommand()
9745 memcpy(&cpu64, begin, sizeof(MachO::x86_thread_state64_t)); in PrintThreadCommand()
9746 begin += sizeof(MachO::x86_thread_state64_t); in PrintThreadCommand()
9748 memset(&cpu64, '\0', sizeof(MachO::x86_thread_state64_t)); in PrintThreadCommand()
9755 } else if (flavor == MachO::x86_THREAD_STATE) { in PrintThreadCommand()
9757 if (count == MachO::x86_THREAD_STATE_COUNT) in PrintThreadCommand()
9762 struct MachO::x86_thread_state_t ts; in PrintThreadCommand()
9764 if (left >= sizeof(MachO::x86_thread_state_t)) { in PrintThreadCommand()
9765 memcpy(&ts, begin, sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9766 begin += sizeof(MachO::x86_thread_state_t); in PrintThreadCommand()
9768 memset(&ts, '\0', sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9774 if (ts.tsh.flavor == MachO::x86_THREAD_STATE64) { in PrintThreadCommand()
9776 if (ts.tsh.count == MachO::x86_THREAD_STATE64_COUNT) in PrintThreadCommand()
9786 } else if (flavor == MachO::x86_FLOAT_STATE) { in PrintThreadCommand()
9788 if (count == MachO::x86_FLOAT_STATE_COUNT) in PrintThreadCommand()
9792 struct MachO::x86_float_state_t fs; in PrintThreadCommand()
9794 if (left >= sizeof(MachO::x86_float_state_t)) { in PrintThreadCommand()
9795 memcpy(&fs, begin, sizeof(MachO::x86_float_state_t)); in PrintThreadCommand()
9796 begin += sizeof(MachO::x86_float_state_t); in PrintThreadCommand()
9798 memset(&fs, '\0', sizeof(MachO::x86_float_state_t)); in PrintThreadCommand()
9804 if (fs.fsh.flavor == MachO::x86_FLOAT_STATE64) { in PrintThreadCommand()
9806 if (fs.fsh.count == MachO::x86_FLOAT_STATE64_COUNT) in PrintThreadCommand()
9816 } else if (flavor == MachO::x86_EXCEPTION_STATE) { in PrintThreadCommand()
9818 if (count == MachO::x86_EXCEPTION_STATE_COUNT) in PrintThreadCommand()
9823 struct MachO::x86_exception_state_t es; in PrintThreadCommand()
9825 if (left >= sizeof(MachO::x86_exception_state_t)) { in PrintThreadCommand()
9826 memcpy(&es, begin, sizeof(MachO::x86_exception_state_t)); in PrintThreadCommand()
9827 begin += sizeof(MachO::x86_exception_state_t); in PrintThreadCommand()
9829 memset(&es, '\0', sizeof(MachO::x86_exception_state_t)); in PrintThreadCommand()
9835 if (es.esh.flavor == MachO::x86_EXCEPTION_STATE64) { in PrintThreadCommand()
9837 if (es.esh.count == MachO::x86_EXCEPTION_STATE64_COUNT) in PrintThreadCommand()
9847 } else if (flavor == MachO::x86_EXCEPTION_STATE64) { in PrintThreadCommand()
9849 if (count == MachO::x86_EXCEPTION_STATE64_COUNT) in PrintThreadCommand()
9854 struct MachO::x86_exception_state64_t es64; in PrintThreadCommand()
9856 if (left >= sizeof(MachO::x86_exception_state64_t)) { in PrintThreadCommand()
9857 memcpy(&es64, begin, sizeof(MachO::x86_exception_state64_t)); in PrintThreadCommand()
9858 begin += sizeof(MachO::x86_exception_state64_t); in PrintThreadCommand()
9860 memset(&es64, '\0', sizeof(MachO::x86_exception_state64_t)); in PrintThreadCommand()
9874 } else if (cputype == MachO::CPU_TYPE_ARM) { in PrintThreadCommand()
9894 if (flavor == MachO::ARM_THREAD_STATE) { in PrintThreadCommand()
9896 if (count == MachO::ARM_THREAD_STATE_COUNT) in PrintThreadCommand()
9901 MachO::arm_thread_state32_t cpu32; in PrintThreadCommand()
9903 if (left >= sizeof(MachO::arm_thread_state32_t)) { in PrintThreadCommand()
9904 memcpy(&cpu32, begin, sizeof(MachO::arm_thread_state32_t)); in PrintThreadCommand()
9905 begin += sizeof(MachO::arm_thread_state32_t); in PrintThreadCommand()
9907 memset(&cpu32, '\0', sizeof(MachO::arm_thread_state32_t)); in PrintThreadCommand()
9921 } else if (cputype == MachO::CPU_TYPE_ARM64 || in PrintThreadCommand()
9922 cputype == MachO::CPU_TYPE_ARM64_32) { in PrintThreadCommand()
9942 if (flavor == MachO::ARM_THREAD_STATE64) { in PrintThreadCommand()
9944 if (count == MachO::ARM_THREAD_STATE64_COUNT) in PrintThreadCommand()
9949 MachO::arm_thread_state64_t cpu64; in PrintThreadCommand()
9951 if (left >= sizeof(MachO::arm_thread_state64_t)) { in PrintThreadCommand()
9952 memcpy(&cpu64, begin, sizeof(MachO::arm_thread_state64_t)); in PrintThreadCommand()
9953 begin += sizeof(MachO::arm_thread_state64_t); in PrintThreadCommand()
9955 memset(&cpu64, '\0', sizeof(MachO::arm_thread_state64_t)); in PrintThreadCommand()
9997 static void PrintDylibCommand(MachO::dylib_command dl, const char *Ptr) { in PrintDylibCommand()
9998 if (dl.cmd == MachO::LC_ID_DYLIB) in PrintDylibCommand()
10000 else if (dl.cmd == MachO::LC_LOAD_DYLIB) in PrintDylibCommand()
10002 else if (dl.cmd == MachO::LC_LOAD_WEAK_DYLIB) in PrintDylibCommand()
10004 else if (dl.cmd == MachO::LC_REEXPORT_DYLIB) in PrintDylibCommand()
10006 else if (dl.cmd == MachO::LC_LAZY_LOAD_DYLIB) in PrintDylibCommand()
10008 else if (dl.cmd == MachO::LC_LOAD_UPWARD_DYLIB) in PrintDylibCommand()
10013 if (dl.cmdsize < sizeof(struct MachO::dylib_command)) in PrintDylibCommand()
10042 static void PrintLinkEditDataCommand(MachO::linkedit_data_command ld, in PrintLinkEditDataCommand()
10044 if (ld.cmd == MachO::LC_CODE_SIGNATURE) in PrintLinkEditDataCommand()
10046 else if (ld.cmd == MachO::LC_SEGMENT_SPLIT_INFO) in PrintLinkEditDataCommand()
10048 else if (ld.cmd == MachO::LC_FUNCTION_STARTS) in PrintLinkEditDataCommand()
10050 else if (ld.cmd == MachO::LC_DATA_IN_CODE) in PrintLinkEditDataCommand()
10052 else if (ld.cmd == MachO::LC_DYLIB_CODE_SIGN_DRS) in PrintLinkEditDataCommand()
10054 else if (ld.cmd == MachO::LC_LINKER_OPTIMIZATION_HINT) in PrintLinkEditDataCommand()
10059 if (ld.cmdsize != sizeof(struct MachO::linkedit_data_command)) in PrintLinkEditDataCommand()
10083 if (Command.C.cmd == MachO::LC_SEGMENT) { in PrintLoadCommands()
10084 MachO::segment_command SLC = Obj->getSegmentLoadCommand(Command); in PrintLoadCommands()
10091 MachO::section S = Obj->getSection(Command, j); in PrintLoadCommands()
10096 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in PrintLoadCommands()
10097 MachO::segment_command_64 SLC_64 = Obj->getSegment64LoadCommand(Command); in PrintLoadCommands()
10104 MachO::section_64 S_64 = Obj->getSection64(Command, j); in PrintLoadCommands()
10110 } else if (Command.C.cmd == MachO::LC_SYMTAB) { in PrintLoadCommands()
10111 MachO::symtab_command Symtab = Obj->getSymtabLoadCommand(); in PrintLoadCommands()
10113 } else if (Command.C.cmd == MachO::LC_DYSYMTAB) { in PrintLoadCommands()
10114 MachO::dysymtab_command Dysymtab = Obj->getDysymtabLoadCommand(); in PrintLoadCommands()
10115 MachO::symtab_command Symtab = Obj->getSymtabLoadCommand(); in PrintLoadCommands()
10118 } else if (Command.C.cmd == MachO::LC_DYLD_INFO || in PrintLoadCommands()
10119 Command.C.cmd == MachO::LC_DYLD_INFO_ONLY) { in PrintLoadCommands()
10120 MachO::dyld_info_command DyldInfo = Obj->getDyldInfoLoadCommand(Command); in PrintLoadCommands()
10122 } else if (Command.C.cmd == MachO::LC_LOAD_DYLINKER || in PrintLoadCommands()
10123 Command.C.cmd == MachO::LC_ID_DYLINKER || in PrintLoadCommands()
10124 Command.C.cmd == MachO::LC_DYLD_ENVIRONMENT) { in PrintLoadCommands()
10125 MachO::dylinker_command Dyld = Obj->getDylinkerCommand(Command); in PrintLoadCommands()
10127 } else if (Command.C.cmd == MachO::LC_UUID) { in PrintLoadCommands()
10128 MachO::uuid_command Uuid = Obj->getUuidCommand(Command); in PrintLoadCommands()
10130 } else if (Command.C.cmd == MachO::LC_RPATH) { in PrintLoadCommands()
10131 MachO::rpath_command Rpath = Obj->getRpathCommand(Command); in PrintLoadCommands()
10133 } else if (Command.C.cmd == MachO::LC_VERSION_MIN_MACOSX || in PrintLoadCommands()
10134 Command.C.cmd == MachO::LC_VERSION_MIN_IPHONEOS || in PrintLoadCommands()
10135 Command.C.cmd == MachO::LC_VERSION_MIN_TVOS || in PrintLoadCommands()
10136 Command.C.cmd == MachO::LC_VERSION_MIN_WATCHOS) { in PrintLoadCommands()
10137 MachO::version_min_command Vd = Obj->getVersionMinLoadCommand(Command); in PrintLoadCommands()
10139 } else if (Command.C.cmd == MachO::LC_NOTE) { in PrintLoadCommands()
10140 MachO::note_command Nt = Obj->getNoteLoadCommand(Command); in PrintLoadCommands()
10142 } else if (Command.C.cmd == MachO::LC_BUILD_VERSION) { in PrintLoadCommands()
10143 MachO::build_version_command Bv = in PrintLoadCommands()
10146 } else if (Command.C.cmd == MachO::LC_SOURCE_VERSION) { in PrintLoadCommands()
10147 MachO::source_version_command Sd = Obj->getSourceVersionCommand(Command); in PrintLoadCommands()
10149 } else if (Command.C.cmd == MachO::LC_MAIN) { in PrintLoadCommands()
10150 MachO::entry_point_command Ep = Obj->getEntryPointCommand(Command); in PrintLoadCommands()
10152 } else if (Command.C.cmd == MachO::LC_ENCRYPTION_INFO) { in PrintLoadCommands()
10153 MachO::encryption_info_command Ei = in PrintLoadCommands()
10156 } else if (Command.C.cmd == MachO::LC_ENCRYPTION_INFO_64) { in PrintLoadCommands()
10157 MachO::encryption_info_command_64 Ei = in PrintLoadCommands()
10160 } else if (Command.C.cmd == MachO::LC_LINKER_OPTION) { in PrintLoadCommands()
10161 MachO::linker_option_command Lo = in PrintLoadCommands()
10164 } else if (Command.C.cmd == MachO::LC_SUB_FRAMEWORK) { in PrintLoadCommands()
10165 MachO::sub_framework_command Sf = Obj->getSubFrameworkCommand(Command); in PrintLoadCommands()
10167 } else if (Command.C.cmd == MachO::LC_SUB_UMBRELLA) { in PrintLoadCommands()
10168 MachO::sub_umbrella_command Sf = Obj->getSubUmbrellaCommand(Command); in PrintLoadCommands()
10170 } else if (Command.C.cmd == MachO::LC_SUB_LIBRARY) { in PrintLoadCommands()
10171 MachO::sub_library_command Sl = Obj->getSubLibraryCommand(Command); in PrintLoadCommands()
10173 } else if (Command.C.cmd == MachO::LC_SUB_CLIENT) { in PrintLoadCommands()
10174 MachO::sub_client_command Sc = Obj->getSubClientCommand(Command); in PrintLoadCommands()
10176 } else if (Command.C.cmd == MachO::LC_ROUTINES) { in PrintLoadCommands()
10177 MachO::routines_command Rc = Obj->getRoutinesCommand(Command); in PrintLoadCommands()
10179 } else if (Command.C.cmd == MachO::LC_ROUTINES_64) { in PrintLoadCommands()
10180 MachO::routines_command_64 Rc = Obj->getRoutinesCommand64(Command); in PrintLoadCommands()
10182 } else if (Command.C.cmd == MachO::LC_THREAD || in PrintLoadCommands()
10183 Command.C.cmd == MachO::LC_UNIXTHREAD) { in PrintLoadCommands()
10184 MachO::thread_command Tc = Obj->getThreadCommand(Command); in PrintLoadCommands()
10186 } else if (Command.C.cmd == MachO::LC_LOAD_DYLIB || in PrintLoadCommands()
10187 Command.C.cmd == MachO::LC_ID_DYLIB || in PrintLoadCommands()
10188 Command.C.cmd == MachO::LC_LOAD_WEAK_DYLIB || in PrintLoadCommands()
10189 Command.C.cmd == MachO::LC_REEXPORT_DYLIB || in PrintLoadCommands()
10190 Command.C.cmd == MachO::LC_LAZY_LOAD_DYLIB || in PrintLoadCommands()
10191 Command.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB) { in PrintLoadCommands()
10192 MachO::dylib_command Dl = Obj->getDylibIDLoadCommand(Command); in PrintLoadCommands()
10194 } else if (Command.C.cmd == MachO::LC_CODE_SIGNATURE || in PrintLoadCommands()
10195 Command.C.cmd == MachO::LC_SEGMENT_SPLIT_INFO || in PrintLoadCommands()
10196 Command.C.cmd == MachO::LC_FUNCTION_STARTS || in PrintLoadCommands()
10197 Command.C.cmd == MachO::LC_DATA_IN_CODE || in PrintLoadCommands()
10198 Command.C.cmd == MachO::LC_DYLIB_CODE_SIGN_DRS || in PrintLoadCommands()
10199 Command.C.cmd == MachO::LC_LINKER_OPTIMIZATION_HINT) { in PrintLoadCommands()
10200 MachO::linkedit_data_command Ld = in PrintLoadCommands()
10215 MachO::mach_header_64 H_64; in PrintMachHeader()
10220 MachO::mach_header H; in PrintMachHeader()
10237 MachO::mach_header_64 H_64; in printMachOLoadCommands()
10242 MachO::mach_header H; in printMachOLoadCommands()
10257 if (Command.C.cmd == MachO::LC_SEGMENT) { in printMachOExportsTrie()
10258 MachO::segment_command Seg = Obj->getSegmentLoadCommand(Command); in printMachOExportsTrie()
10263 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in printMachOExportsTrie()
10264 MachO::segment_command_64 Seg = Obj->getSegment64LoadCommand(Command); in printMachOExportsTrie()
10274 bool ReExport = (Flags & MachO::EXPORT_SYMBOL_FLAGS_REEXPORT); in printMachOExportsTrie()
10275 bool WeakDef = (Flags & MachO::EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION); in printMachOExportsTrie()
10276 bool ThreadLocal = ((Flags & MachO::EXPORT_SYMBOL_FLAGS_KIND_MASK) == in printMachOExportsTrie()
10277 MachO::EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL); in printMachOExportsTrie()
10278 bool Abs = ((Flags & MachO::EXPORT_SYMBOL_FLAGS_KIND_MASK) == in printMachOExportsTrie()
10279 MachO::EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE); in printMachOExportsTrie()
10280 bool Resolver = (Flags & MachO::EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER); in printMachOExportsTrie()
10339 case MachO::BIND_SPECIAL_DYLIB_SELF: in ordinalName()
10341 case MachO::BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE: in ordinalName()
10343 case MachO::BIND_SPECIAL_DYLIB_FLAT_LOOKUP: in ordinalName()
10374 if (Entry.flags() & MachO::BIND_SYMBOL_FLAGS_WEAK_IMPORT) in printMachOBindTable()
10423 if (Entry.flags() & MachO::BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION) { in printMachOWeakBindTable()
10469 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printLazyBindTable() local
10470 printMachOLazyBindTable(MachO); in printLazyBindTable()
10479 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printWeakBindTable() local
10480 printMachOWeakBindTable(MachO); in printWeakBindTable()
10489 if (const MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printExportsTrie() local
10490 printMachOExportsTrie(MachO); in printExportsTrie()
10499 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printRebaseTable() local
10500 printMachORebaseTable(MachO); in printRebaseTable()
10509 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printBindTable() local
10510 printMachOBindTable(MachO); in printBindTable()