Lines Matching refs:MachO

229   case MachO::DICE_KIND_DATA:  in DumpDataInCode()
249 if (Kind == MachO::DICE_KIND_DATA) in DumpDataInCode()
254 case MachO::DICE_KIND_JUMP_TABLE8: in DumpDataInCode()
261 case MachO::DICE_KIND_JUMP_TABLE16: in DumpDataInCode()
269 case MachO::DICE_KIND_JUMP_TABLE32: in DumpDataInCode()
270 case MachO::DICE_KIND_ABS_JUMP_TABLE32: in DumpDataInCode()
275 if (Kind == MachO::DICE_KIND_JUMP_TABLE32) in DumpDataInCode()
301 if (Command.C.cmd == MachO::LC_FUNCTION_STARTS) { in getSectionsAndSymbols()
304 MachO::linkedit_data_command LLC = in getSectionsAndSymbols()
308 } else if (Command.C.cmd == MachO::LC_SEGMENT) { in getSectionsAndSymbols()
309 MachO::segment_command SLC = MachOObj->getSegmentLoadCommand(Command); in getSectionsAndSymbols()
315 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in getSectionsAndSymbols()
316 MachO::segment_command_64 SLC = MachOObj->getSegment64LoadCommand(Command); in getSectionsAndSymbols()
341 if ((Kind == MachO::DICE_KIND_JUMP_TABLE8) && in DumpAndSkipDataInCode()
350 const MachO::any_relocation_info &RE, in printRelocationTargetName()
387 if (O->getAnyRelocationType(RE) == MachO::ARM64_RELOC_ADDEND && in printRelocationTargetName()
426 MachO::any_relocation_info RE = Obj->getRelocation(Rel); in getMachORelocationValueString()
441 case MachO::X86_64_RELOC_GOT_LOAD: in getMachORelocationValueString()
442 case MachO::X86_64_RELOC_GOT: { in getMachORelocationValueString()
449 case MachO::X86_64_RELOC_SUBTRACTOR: { in getMachORelocationValueString()
452 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
458 if (RType != MachO::X86_64_RELOC_UNSIGNED) in getMachORelocationValueString()
469 case MachO::X86_64_RELOC_TLV: in getMachORelocationValueString()
475 case MachO::X86_64_RELOC_SIGNED_1: in getMachORelocationValueString()
479 case MachO::X86_64_RELOC_SIGNED_2: in getMachORelocationValueString()
483 case MachO::X86_64_RELOC_SIGNED_4: in getMachORelocationValueString()
496 case MachO::GENERIC_RELOC_PAIR: // prints no info in getMachORelocationValueString()
498 case MachO::GENERIC_RELOC_SECTDIFF: { in getMachORelocationValueString()
501 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
507 if (RType != MachO::GENERIC_RELOC_PAIR) in getMachORelocationValueString()
520 case MachO::GENERIC_RELOC_LOCAL_SECTDIFF: { in getMachORelocationValueString()
523 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
528 if (RType != MachO::GENERIC_RELOC_PAIR) in getMachORelocationValueString()
537 case MachO::GENERIC_RELOC_TLV: { in getMachORelocationValueString()
549 case MachO::ARM_RELOC_HALF: in getMachORelocationValueString()
550 case MachO::ARM_RELOC_HALF_SECTDIFF: { in getMachORelocationValueString()
563 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
568 if (RType != MachO::ARM_RELOC_PAIR) in getMachORelocationValueString()
579 if (Type == MachO::ARM_RELOC_HALF_SECTDIFF) { in getMachORelocationValueString()
603 MachO::dysymtab_command Dysymtab = O->getDysymtabLoadCommand(); in PrintIndirectSymbolTable()
613 if (cputype & MachO::CPU_ARCH_ABI64) in PrintIndirectSymbolTable()
622 if (cputype & MachO::CPU_ARCH_ABI64) in PrintIndirectSymbolTable()
626 MachO::dysymtab_command Dysymtab = O->getDysymtabLoadCommand(); in PrintIndirectSymbolTable()
628 if (indirect_symbol == MachO::INDIRECT_SYMBOL_LOCAL) { in PrintIndirectSymbolTable()
633 (MachO::INDIRECT_SYMBOL_LOCAL | MachO::INDIRECT_SYMBOL_ABS)) { in PrintIndirectSymbolTable()
637 if (indirect_symbol == MachO::INDIRECT_SYMBOL_ABS) { in PrintIndirectSymbolTable()
643 MachO::symtab_command Symtab = O->getSymtabLoadCommand(); in PrintIndirectSymbolTable()
658 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in PrintIndirectSymbols()
659 MachO::segment_command_64 Seg = O->getSegment64LoadCommand(Load); in PrintIndirectSymbols()
661 MachO::section_64 Sec = O->getSection64(Load, J); in PrintIndirectSymbols()
662 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in PrintIndirectSymbols()
663 if (section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
664 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
665 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in PrintIndirectSymbols()
666 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in PrintIndirectSymbols()
667 section_type == MachO::S_SYMBOL_STUBS) { in PrintIndirectSymbols()
669 if (section_type == MachO::S_SYMBOL_STUBS) in PrintIndirectSymbols()
686 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in PrintIndirectSymbols()
687 MachO::segment_command Seg = O->getSegmentLoadCommand(Load); in PrintIndirectSymbols()
689 MachO::section Sec = O->getSection(Load, J); in PrintIndirectSymbols()
690 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in PrintIndirectSymbols()
691 if (section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
692 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
693 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in PrintIndirectSymbols()
694 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in PrintIndirectSymbols()
695 section_type == MachO::S_SYMBOL_STUBS) { in PrintIndirectSymbols()
697 if (section_type == MachO::S_SYMBOL_STUBS) in PrintIndirectSymbols()
745 case MachO::CPU_TYPE_I386: in PrintRType()
748 case MachO::CPU_TYPE_X86_64: in PrintRType()
751 case MachO::CPU_TYPE_ARM: in PrintRType()
754 case MachO::CPU_TYPE_ARM64: in PrintRType()
755 case MachO::CPU_TYPE_ARM64_32: in PrintRType()
765 if (cputype == MachO::CPU_TYPE_ARM && in PrintRLength()
766 (r_type == MachO::ARM_RELOC_HALF || in PrintRLength()
767 r_type == MachO::ARM_RELOC_HALF_SECTDIFF || previous_arm_half == true)) { in PrintRLength()
788 if (cputype == MachO::CPU_TYPE_X86_64) in PrintRLength()
804 const MachO::symtab_command Symtab = O->getSymtabLoadCommand(); in PrintRelocationEntries()
811 const MachO::any_relocation_info RE = O->getRelocation(Rel); in PrintRelocationEntries()
824 if (r_scattered && cputype != MachO::CPU_TYPE_X86_64) { in PrintRelocationEntries()
827 if ((cputype == MachO::CPU_TYPE_I386 && in PrintRelocationEntries()
828 r_type == MachO::GENERIC_RELOC_PAIR) || in PrintRelocationEntries()
829 (cputype == MachO::CPU_TYPE_ARM && r_type == MachO::ARM_RELOC_PAIR)) in PrintRelocationEntries()
850 if ((cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
851 r_type == MachO::ARM_RELOC_PAIR)) in PrintRelocationEntries()
853 } else if (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
854 sectdiff_r_type == MachO::ARM_RELOC_HALF_SECTDIFF) in PrintRelocationEntries()
856 if ((cputype == MachO::CPU_TYPE_I386 && in PrintRelocationEntries()
857 (r_type == MachO::GENERIC_RELOC_SECTDIFF || in PrintRelocationEntries()
858 r_type == MachO::GENERIC_RELOC_LOCAL_SECTDIFF)) || in PrintRelocationEntries()
859 (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
860 (sectdiff_r_type == MachO::ARM_RELOC_SECTDIFF || in PrintRelocationEntries()
861 sectdiff_r_type == MachO::ARM_RELOC_LOCAL_SECTDIFF || in PrintRelocationEntries()
862 sectdiff_r_type == MachO::ARM_RELOC_HALF_SECTDIFF))) { in PrintRelocationEntries()
869 if (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
870 (r_type == MachO::ARM_RELOC_HALF || in PrintRelocationEntries()
871 r_type == MachO::ARM_RELOC_HALF_SECTDIFF)) in PrintRelocationEntries()
887 if (cputype == MachO::CPU_TYPE_ARM && r_type == MachO::ARM_RELOC_PAIR) in PrintRelocationEntries()
929 if (cputype == MachO::CPU_TYPE_ARM && r_type == MachO::ARM_RELOC_PAIR) in PrintRelocationEntries()
931 else if ((cputype == MachO::CPU_TYPE_ARM64 || in PrintRelocationEntries()
932 cputype == MachO::CPU_TYPE_ARM64_32) && in PrintRelocationEntries()
933 r_type == MachO::ARM64_RELOC_ADDEND) in PrintRelocationEntries()
937 if (r_symbolnum == MachO::R_ABS) in PrintRelocationEntries()
957 if (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
958 (r_type == MachO::ARM_RELOC_HALF || in PrintRelocationEntries()
959 r_type == MachO::ARM_RELOC_HALF_SECTDIFF)) in PrintRelocationEntries()
976 const MachO::dysymtab_command Dysymtab = O->getDysymtabLoadCommand(); in PrintRelocations()
994 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in PrintRelocations()
995 const MachO::segment_command_64 Seg = O->getSegment64LoadCommand(Load); in PrintRelocations()
997 const MachO::section_64 Sec = O->getSection64(Load, J); in PrintRelocations()
1014 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in PrintRelocations()
1015 const MachO::segment_command Seg = O->getSegmentLoadCommand(Load); in PrintRelocations()
1017 const MachO::section Sec = O->getSection(Load, J); in PrintRelocations()
1041 if (Command.C.cmd == MachO::LC_SEGMENT) { in PrintFunctionStarts()
1042 MachO::segment_command SLC = O->getSegmentLoadCommand(Command); in PrintFunctionStarts()
1047 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in PrintFunctionStarts()
1048 MachO::segment_command_64 SLC = O->getSegment64LoadCommand(Command); in PrintFunctionStarts()
1058 if (LC.C.cmd == MachO::LC_FUNCTION_STARTS) { in PrintFunctionStarts()
1059 MachO::linkedit_data_command FunctionStartsLC = in PrintFunctionStarts()
1103 MachO::linkedit_data_command DIC = O->getDataInCodeLoadCommand(); in PrintDataInCodeTable()
1104 uint32_t nentries = DIC.datasize / sizeof(struct MachO::data_in_code_entry); in PrintDataInCodeTable()
1119 case MachO::DICE_KIND_DATA: in PrintDataInCodeTable()
1122 case MachO::DICE_KIND_JUMP_TABLE8: in PrintDataInCodeTable()
1125 case MachO::DICE_KIND_JUMP_TABLE16: in PrintDataInCodeTable()
1128 case MachO::DICE_KIND_JUMP_TABLE32: in PrintDataInCodeTable()
1131 case MachO::DICE_KIND_ABS_JUMP_TABLE32: in PrintDataInCodeTable()
1145 MachO::linkedit_data_command LohLC = O->getLinkOptHintsLoadCommand(); in PrintLinkOptHints()
1204 if (Command.C.cmd == MachO::LC_SEGMENT) { in GetSegmentNames()
1205 MachO::segment_command SLC = O->getSegmentLoadCommand(Command); in GetSegmentNames()
1207 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in GetSegmentNames()
1208 MachO::segment_command_64 SLC = O->getSegment64LoadCommand(Command); in GetSegmentNames()
1216 PrintChainedFixupsHeader(const MachO::dyld_chained_fixups_header &H) { in PrintChainedFixupsHeader()
1226 case llvm::MachO::DYLD_CHAINED_IMPORT: in PrintChainedFixupsHeader()
1229 case llvm::MachO::DYLD_CHAINED_IMPORT_ADDEND: in PrintChainedFixupsHeader()
1232 case llvm::MachO::DYLD_CHAINED_IMPORT_ADDEND64: in PrintChainedFixupsHeader()
1239 if (H.symbols_format == llvm::MachO::DYLD_CHAINED_SYMBOL_ZLIB) in PrintChainedFixupsHeader()
1269 MachO::DYLD_CHAINED_PTR_ARM64E_USERLAND24) in PrintChainedFixupsSegment()
1281 if (PageStart == MachO::DYLD_CHAINED_PTR_START_NONE) in PrintChainedFixupsSegment()
1289 if (Format == MachO::DYLD_CHAINED_IMPORT) in PrintChainedFixupTarget()
1291 else if (Format == MachO::DYLD_CHAINED_IMPORT_ADDEND) in PrintChainedFixupTarget()
1293 else if (Format == MachO::DYLD_CHAINED_IMPORT_ADDEND64) in PrintChainedFixupTarget()
1303 if (Format != MachO::DYLD_CHAINED_IMPORT) in PrintChainedFixupTarget()
1390 if (Entry.flags() & MachO::BIND_SYMBOL_FLAGS_WEAK_IMPORT) in PrintDyldInfo()
1409 if ((JustId && Load.C.cmd == MachO::LC_ID_DYLIB) || in PrintDylibs()
1410 (!JustId && (Load.C.cmd == MachO::LC_ID_DYLIB || in PrintDylibs()
1411 Load.C.cmd == MachO::LC_LOAD_DYLIB || in PrintDylibs()
1412 Load.C.cmd == MachO::LC_LOAD_WEAK_DYLIB || in PrintDylibs()
1413 Load.C.cmd == MachO::LC_REEXPORT_DYLIB || in PrintDylibs()
1414 Load.C.cmd == MachO::LC_LAZY_LOAD_DYLIB || in PrintDylibs()
1415 Load.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB))) { in PrintDylibs()
1416 MachO::dylib_command dl = O->getDylibIDLoadCommand(Load); in PrintDylibs()
1431 if (Load.C.cmd == MachO::LC_LOAD_WEAK_DYLIB) in PrintDylibs()
1433 if (Load.C.cmd == MachO::LC_REEXPORT_DYLIB) in PrintDylibs()
1435 if (Load.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB) in PrintDylibs()
1437 if (Load.C.cmd == MachO::LC_LAZY_LOAD_DYLIB) in PrintDylibs()
1443 if (Load.C.cmd == MachO::LC_ID_DYLIB) in PrintDylibs()
1445 else if (Load.C.cmd == MachO::LC_LOAD_DYLIB) in PrintDylibs()
1447 else if (Load.C.cmd == MachO::LC_LOAD_WEAK_DYLIB) in PrintDylibs()
1449 else if (Load.C.cmd == MachO::LC_LAZY_LOAD_DYLIB) in PrintDylibs()
1451 else if (Load.C.cmd == MachO::LC_REEXPORT_DYLIB) in PrintDylibs()
1453 else if (Load.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB) in PrintDylibs()
1465 if (Command.C.cmd == MachO::LC_RPATH) { in printRpaths()
1657 const MachO::section_64 Sec = O->getSection64(Ref); in DumpLiteralPointerSection()
1658 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1660 const MachO::section Sec = O->getSection(Ref); in DumpLiteralPointerSection()
1661 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1663 if (section_type == MachO::S_CSTRING_LITERALS || in DumpLiteralPointerSection()
1664 section_type == MachO::S_4BYTE_LITERALS || in DumpLiteralPointerSection()
1665 section_type == MachO::S_8BYTE_LITERALS || in DumpLiteralPointerSection()
1666 section_type == MachO::S_16BYTE_LITERALS) in DumpLiteralPointerSection()
1677 MachO::any_relocation_info RE; in DumpLiteralPointerSection()
1747 const MachO::section_64 Sec = O->getSection64(Ref); in DumpLiteralPointerSection()
1748 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1750 const MachO::section Sec = O->getSection(Ref); in DumpLiteralPointerSection()
1751 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1759 case MachO::S_CSTRING_LITERALS: in DumpLiteralPointerSection()
1766 case MachO::S_4BYTE_LITERALS: in DumpLiteralPointerSection()
1777 case MachO::S_8BYTE_LITERALS: { in DumpLiteralPointerSection()
1792 case MachO::S_16BYTE_LITERALS: { in DumpLiteralPointerSection()
1827 MachO::any_relocation_info RE; in DumpInitTermPointerSection()
1881 if (cputype == MachO::CPU_TYPE_I386 || cputype == MachO::CPU_TYPE_X86_64) { in DumpRawSectionContents()
1961 const MachO::section_64 Sec = O->getSection64(Ref); in DumpSectionContents()
1965 const MachO::section Sec = O->getSection(Ref); in DumpSectionContents()
1968 uint32_t section_type = section_flags & MachO::SECTION_TYPE; in DumpSectionContents()
1981 if ((section_flags & MachO::S_ATTR_PURE_INSTRUCTIONS) || in DumpSectionContents()
1982 (section_flags & MachO::S_ATTR_SOME_INSTRUCTIONS)) { in DumpSectionContents()
1995 case MachO::S_REGULAR: in DumpSectionContents()
1998 case MachO::S_ZEROFILL: in DumpSectionContents()
2001 case MachO::S_CSTRING_LITERALS: in DumpSectionContents()
2004 case MachO::S_4BYTE_LITERALS: in DumpSectionContents()
2007 case MachO::S_8BYTE_LITERALS: in DumpSectionContents()
2010 case MachO::S_16BYTE_LITERALS: in DumpSectionContents()
2013 case MachO::S_LITERAL_POINTERS: in DumpSectionContents()
2017 case MachO::S_MOD_INIT_FUNC_POINTERS: in DumpSectionContents()
2018 case MachO::S_MOD_TERM_FUNC_POINTERS: in DumpSectionContents()
2029 if (section_type == MachO::S_ZEROFILL) in DumpSectionContents()
2069 auto *MachO = dyn_cast<MachOObjectFile>(O); in checkMachOAndArchFlags() local
2071 if (!MachO || ArchAll || ArchFlags.empty()) in checkMachOAndArchFlags()
2074 MachO::mach_header H; in checkMachOAndArchFlags()
2075 MachO::mach_header_64 H_64; in checkMachOAndArchFlags()
2078 if (MachO->is64Bit()) { in checkMachOAndArchFlags()
2079 H_64 = MachO->MachOObjectFile::getHeader64(); in checkMachOAndArchFlags()
2083 H = MachO->MachOObjectFile::getHeader(); in checkMachOAndArchFlags()
2159 if (MachOOF->getHeader().filetype == MachO::MH_KEXT_BUNDLE && in ProcessMachO()
2160 MachOOF->getHeader().cputype == MachO::CPU_TYPE_ARM64) in ProcessMachO()
2235 case MachO::CPU_TYPE_I386: in printCPUType()
2237 case MachO::CPU_SUBTYPE_I386_ALL: in printCPUType()
2246 case MachO::CPU_TYPE_X86_64: in printCPUType()
2248 case MachO::CPU_SUBTYPE_X86_64_ALL: in printCPUType()
2252 case MachO::CPU_SUBTYPE_X86_64_H: in printCPUType()
2261 case MachO::CPU_TYPE_ARM: in printCPUType()
2263 case MachO::CPU_SUBTYPE_ARM_ALL: in printCPUType()
2267 case MachO::CPU_SUBTYPE_ARM_V4T: in printCPUType()
2271 case MachO::CPU_SUBTYPE_ARM_V5TEJ: in printCPUType()
2275 case MachO::CPU_SUBTYPE_ARM_XSCALE: in printCPUType()
2279 case MachO::CPU_SUBTYPE_ARM_V6: in printCPUType()
2283 case MachO::CPU_SUBTYPE_ARM_V6M: in printCPUType()
2287 case MachO::CPU_SUBTYPE_ARM_V7: in printCPUType()
2291 case MachO::CPU_SUBTYPE_ARM_V7EM: in printCPUType()
2295 case MachO::CPU_SUBTYPE_ARM_V7K: in printCPUType()
2299 case MachO::CPU_SUBTYPE_ARM_V7M: in printCPUType()
2303 case MachO::CPU_SUBTYPE_ARM_V7S: in printCPUType()
2312 case MachO::CPU_TYPE_ARM64: in printCPUType()
2313 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in printCPUType()
2314 case MachO::CPU_SUBTYPE_ARM64_ALL: in printCPUType()
2318 case MachO::CPU_SUBTYPE_ARM64_V8: in printCPUType()
2322 case MachO::CPU_SUBTYPE_ARM64E: in printCPUType()
2331 case MachO::CPU_TYPE_ARM64_32: in printCPUType()
2332 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in printCPUType()
2333 case MachO::CPU_SUBTYPE_ARM64_32_V8: in printCPUType()
2352 if (UB->getMagic() == MachO::FAT_MAGIC) in printMachOUniversalHeaders()
2357 outs() << "fat_magic " << format("0x%" PRIx32, MachO::FAT_MAGIC) << "\n"; in printMachOUniversalHeaders()
2362 uint64_t big_size = sizeof(struct MachO::fat_header) + in printMachOUniversalHeaders()
2363 nfat_arch * sizeof(struct MachO::fat_arch); in printMachOUniversalHeaders()
2382 (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) == in printMachOUniversalHeaders()
2383 (other_cpusubtype & ~MachO::CPU_SUBTYPE_MASK)) { in printMachOUniversalHeaders()
2390 printCPUType(cputype, cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in printMachOUniversalHeaders()
2394 outs() << " cpusubtype " << (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) in printMachOUniversalHeaders()
2398 (cpusubtype & MachO::CPU_SUBTYPE_MASK) == MachO::CPU_SUBTYPE_LIB64) in printMachOUniversalHeaders()
2403 (cpusubtype & MachO::CPU_SUBTYPE_MASK) >> 24) << "\n"; in printMachOUniversalHeaders()
2827 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
2840 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2854 if (r_type == MachO::GENERIC_RELOC_SECTDIFF || in SymbolizerGetOpInfo()
2855 r_type == MachO::GENERIC_RELOC_LOCAL_SECTDIFF) { in SymbolizerGetOpInfo()
2858 MachO::any_relocation_info RENext; in SymbolizerGetOpInfo()
2884 if (reloc_found && (r_type == MachO::GENERIC_RELOC_SECTDIFF || in SymbolizerGetOpInfo()
2885 r_type == MachO::GENERIC_RELOC_LOCAL_SECTDIFF)) { in SymbolizerGetOpInfo()
2910 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
2914 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2952 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2979 if (Type == MachO::X86_64_RELOC_SUBTRACTOR) { in SymbolizerGetOpInfo()
2982 MachO::any_relocation_info RENext = info->O->getRelocation(RelNext); in SymbolizerGetOpInfo()
2986 if (TypeNext == MachO::X86_64_RELOC_UNSIGNED && isExternNext) { in SymbolizerGetOpInfo()
3005 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
3017 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
3046 if (r_type == MachO::ARM_RELOC_HALF || in SymbolizerGetOpInfo()
3047 r_type == MachO::ARM_RELOC_SECTDIFF || in SymbolizerGetOpInfo()
3048 r_type == MachO::ARM_RELOC_LOCAL_SECTDIFF || in SymbolizerGetOpInfo()
3049 r_type == MachO::ARM_RELOC_HALF_SECTDIFF) { in SymbolizerGetOpInfo()
3052 MachO::any_relocation_info RENext; in SymbolizerGetOpInfo()
3065 case MachO::ARM_RELOC_HALF: in SymbolizerGetOpInfo()
3083 if (isExtern == 0 && (r_type == MachO::ARM_RELOC_BR24 || in SymbolizerGetOpInfo()
3084 r_type == MachO::ARM_THUMB_RELOC_BR22)) in SymbolizerGetOpInfo()
3088 if (r_type == MachO::ARM_RELOC_HALF || in SymbolizerGetOpInfo()
3089 r_type == MachO::ARM_RELOC_HALF_SECTDIFF) { in SymbolizerGetOpInfo()
3095 if (r_scattered && (r_type != MachO::ARM_RELOC_HALF && in SymbolizerGetOpInfo()
3096 r_type != MachO::ARM_RELOC_HALF_SECTDIFF)) { in SymbolizerGetOpInfo()
3101 if (r_type == MachO::ARM_RELOC_HALF_SECTDIFF) { in SymbolizerGetOpInfo()
3125 if (r_type == MachO::ARM_RELOC_HALF) { in SymbolizerGetOpInfo()
3142 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
3163 MachO::any_relocation_info RE = info->O->getRelocation(Rel); in SymbolizerGetOpInfo()
3165 if (r_type == MachO::ARM64_RELOC_ADDEND) { in SymbolizerGetOpInfo()
3168 MachO::any_relocation_info RENext = info->O->getRelocation(RelNext); in SymbolizerGetOpInfo()
3184 case MachO::ARM64_RELOC_PAGE21: in SymbolizerGetOpInfo()
3188 case MachO::ARM64_RELOC_PAGEOFF12: in SymbolizerGetOpInfo()
3192 case MachO::ARM64_RELOC_GOT_LOAD_PAGE21: in SymbolizerGetOpInfo()
3196 case MachO::ARM64_RELOC_GOT_LOAD_PAGEOFF12: in SymbolizerGetOpInfo()
3200 case MachO::ARM64_RELOC_TLVP_LOAD_PAGE21: in SymbolizerGetOpInfo()
3204 case MachO::ARM64_RELOC_TLVP_LOAD_PAGEOFF12: in SymbolizerGetOpInfo()
3209 case MachO::ARM64_RELOC_BRANCH26: in SymbolizerGetOpInfo()
3224 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in GuessCstringPointer()
3225 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load); in GuessCstringPointer()
3227 MachO::section_64 Sec = info->O->getSection64(Load, J); in GuessCstringPointer()
3228 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessCstringPointer()
3229 if (section_type == MachO::S_CSTRING_LITERALS && in GuessCstringPointer()
3245 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in GuessCstringPointer()
3246 MachO::segment_command Seg = info->O->getSegmentLoadCommand(Load); in GuessCstringPointer()
3248 MachO::section Sec = info->O->getSection(Load, J); in GuessCstringPointer()
3249 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessCstringPointer()
3250 if (section_type == MachO::S_CSTRING_LITERALS && in GuessCstringPointer()
3277 MachO::dysymtab_command Dysymtab = info->O->getDysymtabLoadCommand(); in GuessIndirectSymbol()
3278 MachO::symtab_command Symtab = info->O->getSymtabLoadCommand(); in GuessIndirectSymbol()
3280 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in GuessIndirectSymbol()
3281 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load); in GuessIndirectSymbol()
3283 MachO::section_64 Sec = info->O->getSection64(Load, J); in GuessIndirectSymbol()
3284 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessIndirectSymbol()
3285 if ((section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3286 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3287 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in GuessIndirectSymbol()
3288 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in GuessIndirectSymbol()
3289 section_type == MachO::S_SYMBOL_STUBS) && in GuessIndirectSymbol()
3293 if (section_type == MachO::S_SYMBOL_STUBS) in GuessIndirectSymbol()
3311 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in GuessIndirectSymbol()
3312 MachO::segment_command Seg = info->O->getSegmentLoadCommand(Load); in GuessIndirectSymbol()
3314 MachO::section Sec = info->O->getSection(Load, J); in GuessIndirectSymbol()
3315 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessIndirectSymbol()
3316 if ((section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3317 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3318 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in GuessIndirectSymbol()
3319 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in GuessIndirectSymbol()
3320 section_type == MachO::S_SYMBOL_STUBS) && in GuessIndirectSymbol()
3324 if (section_type == MachO::S_SYMBOL_STUBS) in GuessIndirectSymbol()
3431 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in GuessPointerPointer()
3432 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load); in GuessPointerPointer()
3434 MachO::section_64 Sec = info->O->getSection64(Load, J); in GuessPointerPointer()
3544 MachO::any_relocation_info RE; in get_symbol_64()
6798 MachO::mach_header H; in printObjcMetaData()
6800 if (H.cputype == MachO::CPU_TYPE_ARM) in printObjcMetaData()
6837 if (info->O->getHeader().filetype == MachO::MH_OBJECT) { in GuessLiteralPointer()
6842 MachO::any_relocation_info RE; in GuessLiteralPointer()
6866 if (Type == MachO::X86_64_RELOC_SIGNED) { in GuessLiteralPointer()
7204 const MachO::mach_header_64 H_64 = MachOOF->getHeader64(); in getMachODSymObject()
7208 const MachO::mach_header H = MachOOF->getHeader(); in getMachODSymObject()
7370 MachO::mach_header Header = MachOOF->getHeader(); in DisassembleMachO()
7389 if (Header.filetype == MachO::MH_OBJECT) in DisassembleMachO()
8243 if (magic == MachO::MH_MAGIC) in PrintMachHeader()
8245 else if (magic == MachO::MH_MAGIC_64) in PrintMachHeader()
8250 case MachO::CPU_TYPE_I386: in PrintMachHeader()
8252 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8253 case MachO::CPU_SUBTYPE_I386_ALL: in PrintMachHeader()
8257 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8261 case MachO::CPU_TYPE_X86_64: in PrintMachHeader()
8263 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8264 case MachO::CPU_SUBTYPE_X86_64_ALL: in PrintMachHeader()
8267 case MachO::CPU_SUBTYPE_X86_64_H: in PrintMachHeader()
8271 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8275 case MachO::CPU_TYPE_ARM: in PrintMachHeader()
8277 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8278 case MachO::CPU_SUBTYPE_ARM_ALL: in PrintMachHeader()
8281 case MachO::CPU_SUBTYPE_ARM_V4T: in PrintMachHeader()
8284 case MachO::CPU_SUBTYPE_ARM_V5TEJ: in PrintMachHeader()
8287 case MachO::CPU_SUBTYPE_ARM_XSCALE: in PrintMachHeader()
8290 case MachO::CPU_SUBTYPE_ARM_V6: in PrintMachHeader()
8293 case MachO::CPU_SUBTYPE_ARM_V6M: in PrintMachHeader()
8296 case MachO::CPU_SUBTYPE_ARM_V7: in PrintMachHeader()
8299 case MachO::CPU_SUBTYPE_ARM_V7EM: in PrintMachHeader()
8302 case MachO::CPU_SUBTYPE_ARM_V7K: in PrintMachHeader()
8305 case MachO::CPU_SUBTYPE_ARM_V7M: in PrintMachHeader()
8308 case MachO::CPU_SUBTYPE_ARM_V7S: in PrintMachHeader()
8312 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8316 case MachO::CPU_TYPE_ARM64: in PrintMachHeader()
8318 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8319 case MachO::CPU_SUBTYPE_ARM64_ALL: in PrintMachHeader()
8322 case MachO::CPU_SUBTYPE_ARM64_V8: in PrintMachHeader()
8325 case MachO::CPU_SUBTYPE_ARM64E: in PrintMachHeader()
8329 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8333 case MachO::CPU_TYPE_ARM64_32: in PrintMachHeader()
8335 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8336 case MachO::CPU_SUBTYPE_ARM64_32_V8: in PrintMachHeader()
8340 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8344 case MachO::CPU_TYPE_POWERPC: in PrintMachHeader()
8346 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8347 case MachO::CPU_SUBTYPE_POWERPC_ALL: in PrintMachHeader()
8351 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8355 case MachO::CPU_TYPE_POWERPC64: in PrintMachHeader()
8357 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8358 case MachO::CPU_SUBTYPE_POWERPC_ALL: in PrintMachHeader()
8362 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8368 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8371 if ((cpusubtype & MachO::CPU_SUBTYPE_MASK) == MachO::CPU_SUBTYPE_LIB64) { in PrintMachHeader()
8375 (cpusubtype & MachO::CPU_SUBTYPE_MASK) >> 24); in PrintMachHeader()
8378 case MachO::MH_OBJECT: in PrintMachHeader()
8381 case MachO::MH_EXECUTE: in PrintMachHeader()
8384 case MachO::MH_FVMLIB: in PrintMachHeader()
8387 case MachO::MH_CORE: in PrintMachHeader()
8390 case MachO::MH_PRELOAD: in PrintMachHeader()
8393 case MachO::MH_DYLIB: in PrintMachHeader()
8396 case MachO::MH_DYLIB_STUB: in PrintMachHeader()
8399 case MachO::MH_DYLINKER: in PrintMachHeader()
8402 case MachO::MH_BUNDLE: in PrintMachHeader()
8405 case MachO::MH_DSYM: in PrintMachHeader()
8408 case MachO::MH_KEXT_BUNDLE: in PrintMachHeader()
8411 case MachO::MH_FILESET: in PrintMachHeader()
8421 if (f & MachO::MH_NOUNDEFS) { in PrintMachHeader()
8423 f &= ~MachO::MH_NOUNDEFS; in PrintMachHeader()
8425 if (f & MachO::MH_INCRLINK) { in PrintMachHeader()
8427 f &= ~MachO::MH_INCRLINK; in PrintMachHeader()
8429 if (f & MachO::MH_DYLDLINK) { in PrintMachHeader()
8431 f &= ~MachO::MH_DYLDLINK; in PrintMachHeader()
8433 if (f & MachO::MH_BINDATLOAD) { in PrintMachHeader()
8435 f &= ~MachO::MH_BINDATLOAD; in PrintMachHeader()
8437 if (f & MachO::MH_PREBOUND) { in PrintMachHeader()
8439 f &= ~MachO::MH_PREBOUND; in PrintMachHeader()
8441 if (f & MachO::MH_SPLIT_SEGS) { in PrintMachHeader()
8443 f &= ~MachO::MH_SPLIT_SEGS; in PrintMachHeader()
8445 if (f & MachO::MH_LAZY_INIT) { in PrintMachHeader()
8447 f &= ~MachO::MH_LAZY_INIT; in PrintMachHeader()
8449 if (f & MachO::MH_TWOLEVEL) { in PrintMachHeader()
8451 f &= ~MachO::MH_TWOLEVEL; in PrintMachHeader()
8453 if (f & MachO::MH_FORCE_FLAT) { in PrintMachHeader()
8455 f &= ~MachO::MH_FORCE_FLAT; in PrintMachHeader()
8457 if (f & MachO::MH_NOMULTIDEFS) { in PrintMachHeader()
8459 f &= ~MachO::MH_NOMULTIDEFS; in PrintMachHeader()
8461 if (f & MachO::MH_NOFIXPREBINDING) { in PrintMachHeader()
8463 f &= ~MachO::MH_NOFIXPREBINDING; in PrintMachHeader()
8465 if (f & MachO::MH_PREBINDABLE) { in PrintMachHeader()
8467 f &= ~MachO::MH_PREBINDABLE; in PrintMachHeader()
8469 if (f & MachO::MH_ALLMODSBOUND) { in PrintMachHeader()
8471 f &= ~MachO::MH_ALLMODSBOUND; in PrintMachHeader()
8473 if (f & MachO::MH_SUBSECTIONS_VIA_SYMBOLS) { in PrintMachHeader()
8475 f &= ~MachO::MH_SUBSECTIONS_VIA_SYMBOLS; in PrintMachHeader()
8477 if (f & MachO::MH_CANONICAL) { in PrintMachHeader()
8479 f &= ~MachO::MH_CANONICAL; in PrintMachHeader()
8481 if (f & MachO::MH_WEAK_DEFINES) { in PrintMachHeader()
8483 f &= ~MachO::MH_WEAK_DEFINES; in PrintMachHeader()
8485 if (f & MachO::MH_BINDS_TO_WEAK) { in PrintMachHeader()
8487 f &= ~MachO::MH_BINDS_TO_WEAK; in PrintMachHeader()
8489 if (f & MachO::MH_ALLOW_STACK_EXECUTION) { in PrintMachHeader()
8491 f &= ~MachO::MH_ALLOW_STACK_EXECUTION; in PrintMachHeader()
8493 if (f & MachO::MH_DEAD_STRIPPABLE_DYLIB) { in PrintMachHeader()
8495 f &= ~MachO::MH_DEAD_STRIPPABLE_DYLIB; in PrintMachHeader()
8497 if (f & MachO::MH_PIE) { in PrintMachHeader()
8499 f &= ~MachO::MH_PIE; in PrintMachHeader()
8501 if (f & MachO::MH_NO_REEXPORTED_DYLIBS) { in PrintMachHeader()
8503 f &= ~MachO::MH_NO_REEXPORTED_DYLIBS; in PrintMachHeader()
8505 if (f & MachO::MH_HAS_TLV_DESCRIPTORS) { in PrintMachHeader()
8507 f &= ~MachO::MH_HAS_TLV_DESCRIPTORS; in PrintMachHeader()
8509 if (f & MachO::MH_NO_HEAP_EXECUTION) { in PrintMachHeader()
8511 f &= ~MachO::MH_NO_HEAP_EXECUTION; in PrintMachHeader()
8513 if (f & MachO::MH_APP_EXTENSION_SAFE) { in PrintMachHeader()
8515 f &= ~MachO::MH_APP_EXTENSION_SAFE; in PrintMachHeader()
8517 if (f & MachO::MH_NLIST_OUTOFSYNC_WITH_DYLDINFO) { in PrintMachHeader()
8519 f &= ~MachO::MH_NLIST_OUTOFSYNC_WITH_DYLDINFO; in PrintMachHeader()
8526 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8528 (cpusubtype & MachO::CPU_SUBTYPE_MASK) >> 24); in PrintMachHeader()
8545 if (cmd == MachO::LC_SEGMENT) { in PrintSegmentCommand()
8548 expected_cmdsize *= sizeof(struct MachO::section); in PrintSegmentCommand()
8549 expected_cmdsize += sizeof(struct MachO::segment_command); in PrintSegmentCommand()
8553 expected_cmdsize *= sizeof(struct MachO::section_64); in PrintSegmentCommand()
8554 expected_cmdsize += sizeof(struct MachO::segment_command_64); in PrintSegmentCommand()
8562 if (cmd == MachO::LC_SEGMENT_64) { in PrintSegmentCommand()
8581 ~(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | in PrintSegmentCommand()
8582 MachO::VM_PROT_EXECUTE)) != 0) in PrintSegmentCommand()
8586 outs() << ((maxprot & MachO::VM_PROT_READ) ? "r" : "-"); in PrintSegmentCommand()
8587 outs() << ((maxprot & MachO::VM_PROT_WRITE) ? "w" : "-"); in PrintSegmentCommand()
8588 outs() << ((maxprot & MachO::VM_PROT_EXECUTE) ? "x\n" : "-\n"); in PrintSegmentCommand()
8591 ~(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | in PrintSegmentCommand()
8592 MachO::VM_PROT_EXECUTE)) != 0) in PrintSegmentCommand()
8596 outs() << ((initprot & MachO::VM_PROT_READ) ? "r" : "-"); in PrintSegmentCommand()
8597 outs() << ((initprot & MachO::VM_PROT_WRITE) ? "w" : "-"); in PrintSegmentCommand()
8598 outs() << ((initprot & MachO::VM_PROT_EXECUTE) ? "x\n" : "-\n"); in PrintSegmentCommand()
8610 if (flags & MachO::SG_HIGHVM) { in PrintSegmentCommand()
8612 flags &= ~MachO::SG_HIGHVM; in PrintSegmentCommand()
8614 if (flags & MachO::SG_FVMLIB) { in PrintSegmentCommand()
8616 flags &= ~MachO::SG_FVMLIB; in PrintSegmentCommand()
8618 if (flags & MachO::SG_NORELOC) { in PrintSegmentCommand()
8620 flags &= ~MachO::SG_NORELOC; in PrintSegmentCommand()
8622 if (flags & MachO::SG_PROTECTED_VERSION_1) { in PrintSegmentCommand()
8624 flags &= ~MachO::SG_PROTECTED_VERSION_1; in PrintSegmentCommand()
8626 if (flags & MachO::SG_READ_ONLY) { in PrintSegmentCommand()
8630 flags &= ~MachO::SG_READ_ONLY; in PrintSegmentCommand()
8652 if (filetype != MachO::MH_OBJECT && strncmp(sg_segname, segname, 16) != 0) in PrintSection()
8656 if (cmd == MachO::LC_SEGMENT_64) { in PrintSection()
8663 if ((flags & MachO::S_ZEROFILL) != 0 && offset + size > object_size) in PrintSection()
8680 if (reloff + nreloc * sizeof(struct MachO::relocation_info) > object_size) in PrintSection()
8684 uint32_t section_type = flags & MachO::SECTION_TYPE; in PrintSection()
8687 if (section_type == MachO::S_REGULAR) in PrintSection()
8689 else if (section_type == MachO::S_ZEROFILL) in PrintSection()
8691 else if (section_type == MachO::S_CSTRING_LITERALS) in PrintSection()
8693 else if (section_type == MachO::S_4BYTE_LITERALS) in PrintSection()
8695 else if (section_type == MachO::S_8BYTE_LITERALS) in PrintSection()
8697 else if (section_type == MachO::S_16BYTE_LITERALS) in PrintSection()
8699 else if (section_type == MachO::S_LITERAL_POINTERS) in PrintSection()
8701 else if (section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS) in PrintSection()
8703 else if (section_type == MachO::S_LAZY_SYMBOL_POINTERS) in PrintSection()
8705 else if (section_type == MachO::S_SYMBOL_STUBS) in PrintSection()
8707 else if (section_type == MachO::S_MOD_INIT_FUNC_POINTERS) in PrintSection()
8709 else if (section_type == MachO::S_MOD_TERM_FUNC_POINTERS) in PrintSection()
8711 else if (section_type == MachO::S_COALESCED) in PrintSection()
8713 else if (section_type == MachO::S_INTERPOSING) in PrintSection()
8715 else if (section_type == MachO::S_DTRACE_DOF) in PrintSection()
8717 else if (section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS) in PrintSection()
8719 else if (section_type == MachO::S_THREAD_LOCAL_REGULAR) in PrintSection()
8721 else if (section_type == MachO::S_THREAD_LOCAL_ZEROFILL) in PrintSection()
8723 else if (section_type == MachO::S_THREAD_LOCAL_VARIABLES) in PrintSection()
8725 else if (section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS) in PrintSection()
8727 else if (section_type == MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS) in PrintSection()
8729 else if (section_type == MachO::S_INIT_FUNC_OFFSETS) in PrintSection()
8734 uint32_t section_attributes = flags & MachO::SECTION_ATTRIBUTES; in PrintSection()
8735 if (section_attributes & MachO::S_ATTR_PURE_INSTRUCTIONS) in PrintSection()
8737 if (section_attributes & MachO::S_ATTR_NO_TOC) in PrintSection()
8739 if (section_attributes & MachO::S_ATTR_STRIP_STATIC_SYMS) in PrintSection()
8741 if (section_attributes & MachO::S_ATTR_NO_DEAD_STRIP) in PrintSection()
8743 if (section_attributes & MachO::S_ATTR_LIVE_SUPPORT) in PrintSection()
8745 if (section_attributes & MachO::S_ATTR_SELF_MODIFYING_CODE) in PrintSection()
8747 if (section_attributes & MachO::S_ATTR_DEBUG) in PrintSection()
8749 if (section_attributes & MachO::S_ATTR_SOME_INSTRUCTIONS) in PrintSection()
8751 if (section_attributes & MachO::S_ATTR_EXT_RELOC) in PrintSection()
8753 if (section_attributes & MachO::S_ATTR_LOC_RELOC) in PrintSection()
8761 if (section_type == MachO::S_SYMBOL_STUBS || in PrintSection()
8762 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in PrintSection()
8763 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in PrintSection()
8764 section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in PrintSection()
8765 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS) in PrintSection()
8770 if (section_type == MachO::S_SYMBOL_STUBS) in PrintSection()
8776 static void PrintSymtabLoadCommand(MachO::symtab_command st, bool Is64Bit, in PrintSymtabLoadCommand()
8780 if (st.cmdsize != sizeof(struct MachO::symtab_command)) in PrintSymtabLoadCommand()
8793 big_size *= sizeof(struct MachO::nlist_64); in PrintSymtabLoadCommand()
8801 big_size *= sizeof(struct MachO::nlist); in PrintSymtabLoadCommand()
8822 static void PrintDysymtabLoadCommand(MachO::dysymtab_command dyst, in PrintDysymtabLoadCommand()
8827 if (dyst.cmdsize != sizeof(struct MachO::dysymtab_command)) in PrintDysymtabLoadCommand()
8875 big_size *= sizeof(struct MachO::dylib_table_of_contents); in PrintDysymtabLoadCommand()
8890 modtabend *= sizeof(struct MachO::dylib_module_64); in PrintDysymtabLoadCommand()
8894 modtabend *= sizeof(struct MachO::dylib_module); in PrintDysymtabLoadCommand()
8908 big_size *= sizeof(struct MachO::dylib_reference); in PrintDysymtabLoadCommand()
8934 big_size *= sizeof(struct MachO::relocation_info); in PrintDysymtabLoadCommand()
8947 big_size *= sizeof(struct MachO::relocation_info); in PrintDysymtabLoadCommand()
8955 static void PrintDyldInfoLoadCommand(MachO::dyld_info_command dc, in PrintDyldInfoLoadCommand()
8957 if (dc.cmd == MachO::LC_DYLD_INFO) in PrintDyldInfoLoadCommand()
8962 if (dc.cmdsize != sizeof(struct MachO::dyld_info_command)) in PrintDyldInfoLoadCommand()
9029 static void PrintDyldLoadCommand(MachO::dylinker_command dyld, in PrintDyldLoadCommand()
9031 if (dyld.cmd == MachO::LC_ID_DYLINKER) in PrintDyldLoadCommand()
9033 else if (dyld.cmd == MachO::LC_LOAD_DYLINKER) in PrintDyldLoadCommand()
9035 else if (dyld.cmd == MachO::LC_DYLD_ENVIRONMENT) in PrintDyldLoadCommand()
9040 if (dyld.cmdsize < sizeof(struct MachO::dylinker_command)) in PrintDyldLoadCommand()
9052 static void PrintUuidLoadCommand(MachO::uuid_command uuid) { in PrintUuidLoadCommand()
9055 if (uuid.cmdsize != sizeof(struct MachO::uuid_command)) in PrintUuidLoadCommand()
9068 static void PrintRpathLoadCommand(MachO::rpath_command rpath, const char *Ptr) { in PrintRpathLoadCommand()
9071 if (rpath.cmdsize < sizeof(struct MachO::rpath_command)) in PrintRpathLoadCommand()
9083 static void PrintVersionMinLoadCommand(MachO::version_min_command vd) { in PrintVersionMinLoadCommand()
9086 case MachO::LC_VERSION_MIN_MACOSX: in PrintVersionMinLoadCommand()
9089 case MachO::LC_VERSION_MIN_IPHONEOS: in PrintVersionMinLoadCommand()
9092 case MachO::LC_VERSION_MIN_TVOS: in PrintVersionMinLoadCommand()
9095 case MachO::LC_VERSION_MIN_WATCHOS: in PrintVersionMinLoadCommand()
9104 if (vd.cmdsize != sizeof(struct MachO::version_min_command)) in PrintVersionMinLoadCommand()
9128 static void PrintNoteLoadCommand(MachO::note_command Nt) { in PrintNoteLoadCommand()
9131 if (Nt.cmdsize != sizeof(struct MachO::note_command)) in PrintNoteLoadCommand()
9141 static void PrintBuildToolVersion(MachO::build_tool_version bv, bool verbose) { in PrintBuildToolVersion()
9153 MachO::build_version_command bd, in PrintBuildVersionLoadCommand()
9158 sizeof(struct MachO::build_version_command) + in PrintBuildVersionLoadCommand()
9159 bd.ntools * sizeof(struct MachO::build_tool_version)) in PrintBuildVersionLoadCommand()
9178 MachO::build_tool_version bv = obj->getBuildToolVersion(i); in PrintBuildVersionLoadCommand()
9183 static void PrintSourceVersionCommand(MachO::source_version_command sd) { in PrintSourceVersionCommand()
9186 if (sd.cmdsize != sizeof(struct MachO::source_version_command)) in PrintSourceVersionCommand()
9205 static void PrintEntryPointCommand(MachO::entry_point_command ep) { in PrintEntryPointCommand()
9208 if (ep.cmdsize != sizeof(struct MachO::entry_point_command)) in PrintEntryPointCommand()
9216 static void PrintEncryptionInfoCommand(MachO::encryption_info_command ec, in PrintEncryptionInfoCommand()
9220 if (ec.cmdsize != sizeof(struct MachO::encryption_info_command)) in PrintEncryptionInfoCommand()
9237 static void PrintEncryptionInfoCommand64(MachO::encryption_info_command_64 ec, in PrintEncryptionInfoCommand64()
9241 if (ec.cmdsize != sizeof(struct MachO::encryption_info_command_64)) in PrintEncryptionInfoCommand64()
9259 static void PrintLinkerOptionCommand(MachO::linker_option_command lo, in PrintLinkerOptionCommand()
9263 if (lo.cmdsize < sizeof(struct MachO::linker_option_command)) in PrintLinkerOptionCommand()
9268 const char *string = Ptr + sizeof(struct MachO::linker_option_command); in PrintLinkerOptionCommand()
9269 uint32_t left = lo.cmdsize - sizeof(struct MachO::linker_option_command); in PrintLinkerOptionCommand()
9290 static void PrintSubFrameworkCommand(MachO::sub_framework_command sub, in PrintSubFrameworkCommand()
9294 if (sub.cmdsize < sizeof(struct MachO::sub_framework_command)) in PrintSubFrameworkCommand()
9306 static void PrintSubUmbrellaCommand(MachO::sub_umbrella_command sub, in PrintSubUmbrellaCommand()
9310 if (sub.cmdsize < sizeof(struct MachO::sub_umbrella_command)) in PrintSubUmbrellaCommand()
9322 static void PrintSubLibraryCommand(MachO::sub_library_command sub, in PrintSubLibraryCommand()
9326 if (sub.cmdsize < sizeof(struct MachO::sub_library_command)) in PrintSubLibraryCommand()
9338 static void PrintSubClientCommand(MachO::sub_client_command sub, in PrintSubClientCommand()
9342 if (sub.cmdsize < sizeof(struct MachO::sub_client_command)) in PrintSubClientCommand()
9354 static void PrintRoutinesCommand(MachO::routines_command r) { in PrintRoutinesCommand()
9357 if (r.cmdsize != sizeof(struct MachO::routines_command)) in PrintRoutinesCommand()
9371 static void PrintRoutinesCommand64(MachO::routines_command_64 r) { in PrintRoutinesCommand64()
9374 if (r.cmdsize != sizeof(struct MachO::routines_command_64)) in PrintRoutinesCommand64()
9388 static void Print_x86_thread_state32_t(MachO::x86_thread_state32_t &cpu32) { in Print_x86_thread_state32_t()
9407 static void Print_x86_thread_state64_t(MachO::x86_thread_state64_t &cpu64) { in Print_x86_thread_state64_t()
9431 static void Print_mmst_reg(MachO::mmst_reg_t &r) { in Print_mmst_reg()
9443 static void Print_xmm_reg(MachO::xmm_reg_t &r) { in Print_xmm_reg()
9451 static void Print_x86_float_state_t(MachO::x86_float_state64_t &fpu) { in Print_x86_float_state_t()
9461 if (fpu.fpu_fcw.pc == MachO::x86_FP_PREC_24B) in Print_x86_float_state_t()
9463 else if (fpu.fpu_fcw.pc == MachO::x86_FP_PREC_53B) in Print_x86_float_state_t()
9465 else if (fpu.fpu_fcw.pc == MachO::x86_FP_PREC_64B) in Print_x86_float_state_t()
9470 if (fpu.fpu_fcw.rc == MachO::x86_FP_RND_NEAR) in Print_x86_float_state_t()
9472 else if (fpu.fpu_fcw.rc == MachO::x86_FP_RND_DOWN) in Print_x86_float_state_t()
9474 else if (fpu.fpu_fcw.rc == MachO::x86_FP_RND_UP) in Print_x86_float_state_t()
9476 else if (fpu.fpu_fcw.rc == MachO::x86_FP_CHOP) in Print_x86_float_state_t()
9564 static void Print_x86_exception_state_t(MachO::x86_exception_state64_t &exc64) { in Print_x86_exception_state_t()
9570 static void Print_arm_thread_state32_t(MachO::arm_thread_state32_t &cpu32) { in Print_arm_thread_state32_t()
9590 static void Print_arm_thread_state64_t(MachO::arm_thread_state64_t &cpu64) { in Print_arm_thread_state64_t()
9627 static void PrintThreadCommand(MachO::thread_command t, const char *Ptr, in PrintThreadCommand()
9629 if (t.cmd == MachO::LC_THREAD) in PrintThreadCommand()
9631 else if (t.cmd == MachO::LC_UNIXTHREAD) in PrintThreadCommand()
9636 if (t.cmdsize < sizeof(struct MachO::thread_command) + 2 * sizeof(uint32_t)) in PrintThreadCommand()
9641 const char *begin = Ptr + sizeof(struct MachO::thread_command); in PrintThreadCommand()
9644 if (cputype == MachO::CPU_TYPE_I386) { in PrintThreadCommand()
9664 if (flavor == MachO::x86_THREAD_STATE32) { in PrintThreadCommand()
9666 if (count == MachO::x86_THREAD_STATE32_COUNT) in PrintThreadCommand()
9671 MachO::x86_thread_state32_t cpu32; in PrintThreadCommand()
9673 if (left >= sizeof(MachO::x86_thread_state32_t)) { in PrintThreadCommand()
9674 memcpy(&cpu32, begin, sizeof(MachO::x86_thread_state32_t)); in PrintThreadCommand()
9675 begin += sizeof(MachO::x86_thread_state32_t); in PrintThreadCommand()
9677 memset(&cpu32, '\0', sizeof(MachO::x86_thread_state32_t)); in PrintThreadCommand()
9684 } else if (flavor == MachO::x86_THREAD_STATE) { in PrintThreadCommand()
9686 if (count == MachO::x86_THREAD_STATE_COUNT) in PrintThreadCommand()
9691 struct MachO::x86_thread_state_t ts; in PrintThreadCommand()
9693 if (left >= sizeof(MachO::x86_thread_state_t)) { in PrintThreadCommand()
9694 memcpy(&ts, begin, sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9695 begin += sizeof(MachO::x86_thread_state_t); in PrintThreadCommand()
9697 memset(&ts, '\0', sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9703 if (ts.tsh.flavor == MachO::x86_THREAD_STATE32) { in PrintThreadCommand()
9705 if (ts.tsh.count == MachO::x86_THREAD_STATE32_COUNT) in PrintThreadCommand()
9722 } else if (cputype == MachO::CPU_TYPE_X86_64) { in PrintThreadCommand()
9742 if (flavor == MachO::x86_THREAD_STATE64) { in PrintThreadCommand()
9744 if (count == MachO::x86_THREAD_STATE64_COUNT) in PrintThreadCommand()
9749 MachO::x86_thread_state64_t cpu64; in PrintThreadCommand()
9751 if (left >= sizeof(MachO::x86_thread_state64_t)) { in PrintThreadCommand()
9752 memcpy(&cpu64, begin, sizeof(MachO::x86_thread_state64_t)); in PrintThreadCommand()
9753 begin += sizeof(MachO::x86_thread_state64_t); in PrintThreadCommand()
9755 memset(&cpu64, '\0', sizeof(MachO::x86_thread_state64_t)); in PrintThreadCommand()
9762 } else if (flavor == MachO::x86_THREAD_STATE) { in PrintThreadCommand()
9764 if (count == MachO::x86_THREAD_STATE_COUNT) in PrintThreadCommand()
9769 struct MachO::x86_thread_state_t ts; in PrintThreadCommand()
9771 if (left >= sizeof(MachO::x86_thread_state_t)) { in PrintThreadCommand()
9772 memcpy(&ts, begin, sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9773 begin += sizeof(MachO::x86_thread_state_t); in PrintThreadCommand()
9775 memset(&ts, '\0', sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9781 if (ts.tsh.flavor == MachO::x86_THREAD_STATE64) { in PrintThreadCommand()
9783 if (ts.tsh.count == MachO::x86_THREAD_STATE64_COUNT) in PrintThreadCommand()
9793 } else if (flavor == MachO::x86_FLOAT_STATE) { in PrintThreadCommand()
9795 if (count == MachO::x86_FLOAT_STATE_COUNT) in PrintThreadCommand()
9799 struct MachO::x86_float_state_t fs; in PrintThreadCommand()
9801 if (left >= sizeof(MachO::x86_float_state_t)) { in PrintThreadCommand()
9802 memcpy(&fs, begin, sizeof(MachO::x86_float_state_t)); in PrintThreadCommand()
9803 begin += sizeof(MachO::x86_float_state_t); in PrintThreadCommand()
9805 memset(&fs, '\0', sizeof(MachO::x86_float_state_t)); in PrintThreadCommand()
9811 if (fs.fsh.flavor == MachO::x86_FLOAT_STATE64) { in PrintThreadCommand()
9813 if (fs.fsh.count == MachO::x86_FLOAT_STATE64_COUNT) in PrintThreadCommand()
9823 } else if (flavor == MachO::x86_EXCEPTION_STATE) { in PrintThreadCommand()
9825 if (count == MachO::x86_EXCEPTION_STATE_COUNT) in PrintThreadCommand()
9830 struct MachO::x86_exception_state_t es; in PrintThreadCommand()
9832 if (left >= sizeof(MachO::x86_exception_state_t)) { in PrintThreadCommand()
9833 memcpy(&es, begin, sizeof(MachO::x86_exception_state_t)); in PrintThreadCommand()
9834 begin += sizeof(MachO::x86_exception_state_t); in PrintThreadCommand()
9836 memset(&es, '\0', sizeof(MachO::x86_exception_state_t)); in PrintThreadCommand()
9842 if (es.esh.flavor == MachO::x86_EXCEPTION_STATE64) { in PrintThreadCommand()
9844 if (es.esh.count == MachO::x86_EXCEPTION_STATE64_COUNT) in PrintThreadCommand()
9854 } else if (flavor == MachO::x86_EXCEPTION_STATE64) { in PrintThreadCommand()
9856 if (count == MachO::x86_EXCEPTION_STATE64_COUNT) in PrintThreadCommand()
9861 struct MachO::x86_exception_state64_t es64; in PrintThreadCommand()
9863 if (left >= sizeof(MachO::x86_exception_state64_t)) { in PrintThreadCommand()
9864 memcpy(&es64, begin, sizeof(MachO::x86_exception_state64_t)); in PrintThreadCommand()
9865 begin += sizeof(MachO::x86_exception_state64_t); in PrintThreadCommand()
9867 memset(&es64, '\0', sizeof(MachO::x86_exception_state64_t)); in PrintThreadCommand()
9881 } else if (cputype == MachO::CPU_TYPE_ARM) { in PrintThreadCommand()
9901 if (flavor == MachO::ARM_THREAD_STATE) { in PrintThreadCommand()
9903 if (count == MachO::ARM_THREAD_STATE_COUNT) in PrintThreadCommand()
9908 MachO::arm_thread_state32_t cpu32; in PrintThreadCommand()
9910 if (left >= sizeof(MachO::arm_thread_state32_t)) { in PrintThreadCommand()
9911 memcpy(&cpu32, begin, sizeof(MachO::arm_thread_state32_t)); in PrintThreadCommand()
9912 begin += sizeof(MachO::arm_thread_state32_t); in PrintThreadCommand()
9914 memset(&cpu32, '\0', sizeof(MachO::arm_thread_state32_t)); in PrintThreadCommand()
9928 } else if (cputype == MachO::CPU_TYPE_ARM64 || in PrintThreadCommand()
9929 cputype == MachO::CPU_TYPE_ARM64_32) { in PrintThreadCommand()
9949 if (flavor == MachO::ARM_THREAD_STATE64) { in PrintThreadCommand()
9951 if (count == MachO::ARM_THREAD_STATE64_COUNT) in PrintThreadCommand()
9956 MachO::arm_thread_state64_t cpu64; in PrintThreadCommand()
9958 if (left >= sizeof(MachO::arm_thread_state64_t)) { in PrintThreadCommand()
9959 memcpy(&cpu64, begin, sizeof(MachO::arm_thread_state64_t)); in PrintThreadCommand()
9960 begin += sizeof(MachO::arm_thread_state64_t); in PrintThreadCommand()
9962 memset(&cpu64, '\0', sizeof(MachO::arm_thread_state64_t)); in PrintThreadCommand()
10004 static void PrintDylibCommand(MachO::dylib_command dl, const char *Ptr) { in PrintDylibCommand()
10005 if (dl.cmd == MachO::LC_ID_DYLIB) in PrintDylibCommand()
10007 else if (dl.cmd == MachO::LC_LOAD_DYLIB) in PrintDylibCommand()
10009 else if (dl.cmd == MachO::LC_LOAD_WEAK_DYLIB) in PrintDylibCommand()
10011 else if (dl.cmd == MachO::LC_REEXPORT_DYLIB) in PrintDylibCommand()
10013 else if (dl.cmd == MachO::LC_LAZY_LOAD_DYLIB) in PrintDylibCommand()
10015 else if (dl.cmd == MachO::LC_LOAD_UPWARD_DYLIB) in PrintDylibCommand()
10020 if (dl.cmdsize < sizeof(struct MachO::dylib_command)) in PrintDylibCommand()
10049 static void PrintLinkEditDataCommand(MachO::linkedit_data_command ld, in PrintLinkEditDataCommand()
10051 if (ld.cmd == MachO::LC_CODE_SIGNATURE) in PrintLinkEditDataCommand()
10053 else if (ld.cmd == MachO::LC_SEGMENT_SPLIT_INFO) in PrintLinkEditDataCommand()
10055 else if (ld.cmd == MachO::LC_FUNCTION_STARTS) in PrintLinkEditDataCommand()
10057 else if (ld.cmd == MachO::LC_DATA_IN_CODE) in PrintLinkEditDataCommand()
10059 else if (ld.cmd == MachO::LC_DYLIB_CODE_SIGN_DRS) in PrintLinkEditDataCommand()
10061 else if (ld.cmd == MachO::LC_LINKER_OPTIMIZATION_HINT) in PrintLinkEditDataCommand()
10063 else if (ld.cmd == MachO::LC_DYLD_EXPORTS_TRIE) in PrintLinkEditDataCommand()
10065 else if (ld.cmd == MachO::LC_DYLD_CHAINED_FIXUPS) in PrintLinkEditDataCommand()
10067 else if (ld.cmd == MachO::LC_ATOM_INFO) in PrintLinkEditDataCommand()
10072 if (ld.cmdsize != sizeof(struct MachO::linkedit_data_command)) in PrintLinkEditDataCommand()
10096 if (Command.C.cmd == MachO::LC_SEGMENT) { in PrintLoadCommands()
10097 MachO::segment_command SLC = Obj->getSegmentLoadCommand(Command); in PrintLoadCommands()
10104 MachO::section S = Obj->getSection(Command, j); in PrintLoadCommands()
10109 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in PrintLoadCommands()
10110 MachO::segment_command_64 SLC_64 = Obj->getSegment64LoadCommand(Command); in PrintLoadCommands()
10117 MachO::section_64 S_64 = Obj->getSection64(Command, j); in PrintLoadCommands()
10123 } else if (Command.C.cmd == MachO::LC_SYMTAB) { in PrintLoadCommands()
10124 MachO::symtab_command Symtab = Obj->getSymtabLoadCommand(); in PrintLoadCommands()
10126 } else if (Command.C.cmd == MachO::LC_DYSYMTAB) { in PrintLoadCommands()
10127 MachO::dysymtab_command Dysymtab = Obj->getDysymtabLoadCommand(); in PrintLoadCommands()
10128 MachO::symtab_command Symtab = Obj->getSymtabLoadCommand(); in PrintLoadCommands()
10131 } else if (Command.C.cmd == MachO::LC_DYLD_INFO || in PrintLoadCommands()
10132 Command.C.cmd == MachO::LC_DYLD_INFO_ONLY) { in PrintLoadCommands()
10133 MachO::dyld_info_command DyldInfo = Obj->getDyldInfoLoadCommand(Command); in PrintLoadCommands()
10135 } else if (Command.C.cmd == MachO::LC_LOAD_DYLINKER || in PrintLoadCommands()
10136 Command.C.cmd == MachO::LC_ID_DYLINKER || in PrintLoadCommands()
10137 Command.C.cmd == MachO::LC_DYLD_ENVIRONMENT) { in PrintLoadCommands()
10138 MachO::dylinker_command Dyld = Obj->getDylinkerCommand(Command); in PrintLoadCommands()
10140 } else if (Command.C.cmd == MachO::LC_UUID) { in PrintLoadCommands()
10141 MachO::uuid_command Uuid = Obj->getUuidCommand(Command); in PrintLoadCommands()
10143 } else if (Command.C.cmd == MachO::LC_RPATH) { in PrintLoadCommands()
10144 MachO::rpath_command Rpath = Obj->getRpathCommand(Command); in PrintLoadCommands()
10146 } else if (Command.C.cmd == MachO::LC_VERSION_MIN_MACOSX || in PrintLoadCommands()
10147 Command.C.cmd == MachO::LC_VERSION_MIN_IPHONEOS || in PrintLoadCommands()
10148 Command.C.cmd == MachO::LC_VERSION_MIN_TVOS || in PrintLoadCommands()
10149 Command.C.cmd == MachO::LC_VERSION_MIN_WATCHOS) { in PrintLoadCommands()
10150 MachO::version_min_command Vd = Obj->getVersionMinLoadCommand(Command); in PrintLoadCommands()
10152 } else if (Command.C.cmd == MachO::LC_NOTE) { in PrintLoadCommands()
10153 MachO::note_command Nt = Obj->getNoteLoadCommand(Command); in PrintLoadCommands()
10155 } else if (Command.C.cmd == MachO::LC_BUILD_VERSION) { in PrintLoadCommands()
10156 MachO::build_version_command Bv = in PrintLoadCommands()
10159 } else if (Command.C.cmd == MachO::LC_SOURCE_VERSION) { in PrintLoadCommands()
10160 MachO::source_version_command Sd = Obj->getSourceVersionCommand(Command); in PrintLoadCommands()
10162 } else if (Command.C.cmd == MachO::LC_MAIN) { in PrintLoadCommands()
10163 MachO::entry_point_command Ep = Obj->getEntryPointCommand(Command); in PrintLoadCommands()
10165 } else if (Command.C.cmd == MachO::LC_ENCRYPTION_INFO) { in PrintLoadCommands()
10166 MachO::encryption_info_command Ei = in PrintLoadCommands()
10169 } else if (Command.C.cmd == MachO::LC_ENCRYPTION_INFO_64) { in PrintLoadCommands()
10170 MachO::encryption_info_command_64 Ei = in PrintLoadCommands()
10173 } else if (Command.C.cmd == MachO::LC_LINKER_OPTION) { in PrintLoadCommands()
10174 MachO::linker_option_command Lo = in PrintLoadCommands()
10177 } else if (Command.C.cmd == MachO::LC_SUB_FRAMEWORK) { in PrintLoadCommands()
10178 MachO::sub_framework_command Sf = Obj->getSubFrameworkCommand(Command); in PrintLoadCommands()
10180 } else if (Command.C.cmd == MachO::LC_SUB_UMBRELLA) { in PrintLoadCommands()
10181 MachO::sub_umbrella_command Sf = Obj->getSubUmbrellaCommand(Command); in PrintLoadCommands()
10183 } else if (Command.C.cmd == MachO::LC_SUB_LIBRARY) { in PrintLoadCommands()
10184 MachO::sub_library_command Sl = Obj->getSubLibraryCommand(Command); in PrintLoadCommands()
10186 } else if (Command.C.cmd == MachO::LC_SUB_CLIENT) { in PrintLoadCommands()
10187 MachO::sub_client_command Sc = Obj->getSubClientCommand(Command); in PrintLoadCommands()
10189 } else if (Command.C.cmd == MachO::LC_ROUTINES) { in PrintLoadCommands()
10190 MachO::routines_command Rc = Obj->getRoutinesCommand(Command); in PrintLoadCommands()
10192 } else if (Command.C.cmd == MachO::LC_ROUTINES_64) { in PrintLoadCommands()
10193 MachO::routines_command_64 Rc = Obj->getRoutinesCommand64(Command); in PrintLoadCommands()
10195 } else if (Command.C.cmd == MachO::LC_THREAD || in PrintLoadCommands()
10196 Command.C.cmd == MachO::LC_UNIXTHREAD) { in PrintLoadCommands()
10197 MachO::thread_command Tc = Obj->getThreadCommand(Command); in PrintLoadCommands()
10199 } else if (Command.C.cmd == MachO::LC_LOAD_DYLIB || in PrintLoadCommands()
10200 Command.C.cmd == MachO::LC_ID_DYLIB || in PrintLoadCommands()
10201 Command.C.cmd == MachO::LC_LOAD_WEAK_DYLIB || in PrintLoadCommands()
10202 Command.C.cmd == MachO::LC_REEXPORT_DYLIB || in PrintLoadCommands()
10203 Command.C.cmd == MachO::LC_LAZY_LOAD_DYLIB || in PrintLoadCommands()
10204 Command.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB) { in PrintLoadCommands()
10205 MachO::dylib_command Dl = Obj->getDylibIDLoadCommand(Command); in PrintLoadCommands()
10207 } else if (Command.C.cmd == MachO::LC_CODE_SIGNATURE || in PrintLoadCommands()
10208 Command.C.cmd == MachO::LC_SEGMENT_SPLIT_INFO || in PrintLoadCommands()
10209 Command.C.cmd == MachO::LC_FUNCTION_STARTS || in PrintLoadCommands()
10210 Command.C.cmd == MachO::LC_DATA_IN_CODE || in PrintLoadCommands()
10211 Command.C.cmd == MachO::LC_DYLIB_CODE_SIGN_DRS || in PrintLoadCommands()
10212 Command.C.cmd == MachO::LC_LINKER_OPTIMIZATION_HINT || in PrintLoadCommands()
10213 Command.C.cmd == MachO::LC_DYLD_EXPORTS_TRIE || in PrintLoadCommands()
10214 Command.C.cmd == MachO::LC_DYLD_CHAINED_FIXUPS || in PrintLoadCommands()
10215 Command.C.cmd == MachO::LC_ATOM_INFO) { in PrintLoadCommands()
10216 MachO::linkedit_data_command Ld = in PrintLoadCommands()
10231 MachO::mach_header_64 H_64; in PrintMachHeader()
10236 MachO::mach_header H; in PrintMachHeader()
10259 MachO::mach_header_64 H_64; in printMachOLoadCommands()
10264 MachO::mach_header H; in printMachOLoadCommands()
10279 if (Command.C.cmd == MachO::LC_SEGMENT) { in printMachOExportsTrie()
10280 MachO::segment_command Seg = Obj->getSegmentLoadCommand(Command); in printMachOExportsTrie()
10285 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in printMachOExportsTrie()
10286 MachO::segment_command_64 Seg = Obj->getSegment64LoadCommand(Command); in printMachOExportsTrie()
10296 bool ReExport = (Flags & MachO::EXPORT_SYMBOL_FLAGS_REEXPORT); in printMachOExportsTrie()
10297 bool WeakDef = (Flags & MachO::EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION); in printMachOExportsTrie()
10298 bool ThreadLocal = ((Flags & MachO::EXPORT_SYMBOL_FLAGS_KIND_MASK) == in printMachOExportsTrie()
10299 MachO::EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL); in printMachOExportsTrie()
10300 bool Abs = ((Flags & MachO::EXPORT_SYMBOL_FLAGS_KIND_MASK) == in printMachOExportsTrie()
10301 MachO::EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE); in printMachOExportsTrie()
10302 bool Resolver = (Flags & MachO::EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER); in printMachOExportsTrie()
10361 case MachO::BIND_SPECIAL_DYLIB_SELF: in ordinalName()
10363 case MachO::BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE: in ordinalName()
10365 case MachO::BIND_SPECIAL_DYLIB_FLAT_LOOKUP: in ordinalName()
10367 case MachO::BIND_SPECIAL_DYLIB_WEAK_LOOKUP: in ordinalName()
10398 if (Entry.flags() & MachO::BIND_SYMBOL_FLAGS_WEAK_IMPORT) in printMachOBindTable()
10447 if (Entry.flags() & MachO::BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION) { in printMachOWeakBindTable()
10493 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printLazyBindTable() local
10494 printMachOLazyBindTable(MachO); in printLazyBindTable()
10503 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printWeakBindTable() local
10504 printMachOWeakBindTable(MachO); in printWeakBindTable()
10513 if (const MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printExportsTrie() local
10514 printMachOExportsTrie(MachO); in printExportsTrie()
10523 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printRebaseTable() local
10524 printMachORebaseTable(MachO); in printRebaseTable()
10533 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printBindTable() local
10534 printMachOBindTable(MachO); in printBindTable()