Lines Matching refs:MachO
242 case MachO::DICE_KIND_DATA: in DumpDataInCode()
262 if (Kind == MachO::DICE_KIND_DATA) in DumpDataInCode()
267 case MachO::DICE_KIND_JUMP_TABLE8: in DumpDataInCode()
274 case MachO::DICE_KIND_JUMP_TABLE16: in DumpDataInCode()
282 case MachO::DICE_KIND_JUMP_TABLE32: in DumpDataInCode()
283 case MachO::DICE_KIND_ABS_JUMP_TABLE32: in DumpDataInCode()
288 if (Kind == MachO::DICE_KIND_JUMP_TABLE32) in DumpDataInCode()
314 if (Command.C.cmd == MachO::LC_FUNCTION_STARTS) { in getSectionsAndSymbols()
317 MachO::linkedit_data_command LLC = in getSectionsAndSymbols()
321 } else if (Command.C.cmd == MachO::LC_SEGMENT) { in getSectionsAndSymbols()
322 MachO::segment_command SLC = MachOObj->getSegmentLoadCommand(Command); in getSectionsAndSymbols()
328 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in getSectionsAndSymbols()
329 MachO::segment_command_64 SLC = MachOObj->getSegment64LoadCommand(Command); in getSectionsAndSymbols()
354 if ((Kind == MachO::DICE_KIND_JUMP_TABLE8) && in DumpAndSkipDataInCode()
363 const MachO::any_relocation_info &RE, in printRelocationTargetName()
400 if (O->getAnyRelocationType(RE) == MachO::ARM64_RELOC_ADDEND && in printRelocationTargetName()
439 MachO::any_relocation_info RE = Obj->getRelocation(Rel); in getMachORelocationValueString()
454 case MachO::X86_64_RELOC_GOT_LOAD: in getMachORelocationValueString()
455 case MachO::X86_64_RELOC_GOT: { in getMachORelocationValueString()
462 case MachO::X86_64_RELOC_SUBTRACTOR: { in getMachORelocationValueString()
465 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
471 if (RType != MachO::X86_64_RELOC_UNSIGNED) in getMachORelocationValueString()
482 case MachO::X86_64_RELOC_TLV: in getMachORelocationValueString()
488 case MachO::X86_64_RELOC_SIGNED_1: in getMachORelocationValueString()
492 case MachO::X86_64_RELOC_SIGNED_2: in getMachORelocationValueString()
496 case MachO::X86_64_RELOC_SIGNED_4: in getMachORelocationValueString()
509 case MachO::GENERIC_RELOC_PAIR: // prints no info in getMachORelocationValueString()
511 case MachO::GENERIC_RELOC_SECTDIFF: { in getMachORelocationValueString()
514 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
520 if (RType != MachO::GENERIC_RELOC_PAIR) in getMachORelocationValueString()
533 case MachO::GENERIC_RELOC_LOCAL_SECTDIFF: { in getMachORelocationValueString()
536 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
541 if (RType != MachO::GENERIC_RELOC_PAIR) in getMachORelocationValueString()
550 case MachO::GENERIC_RELOC_TLV: { in getMachORelocationValueString()
562 case MachO::ARM_RELOC_HALF: in getMachORelocationValueString()
563 case MachO::ARM_RELOC_HALF_SECTDIFF: { in getMachORelocationValueString()
576 MachO::any_relocation_info RENext = Obj->getRelocation(RelNext); in getMachORelocationValueString()
581 if (RType != MachO::ARM_RELOC_PAIR) in getMachORelocationValueString()
592 if (Type == MachO::ARM_RELOC_HALF_SECTDIFF) { in getMachORelocationValueString()
616 MachO::dysymtab_command Dysymtab = O->getDysymtabLoadCommand(); in PrintIndirectSymbolTable()
626 if (cputype & MachO::CPU_ARCH_ABI64) in PrintIndirectSymbolTable()
635 if (cputype & MachO::CPU_ARCH_ABI64) in PrintIndirectSymbolTable()
639 MachO::dysymtab_command Dysymtab = O->getDysymtabLoadCommand(); in PrintIndirectSymbolTable()
641 if (indirect_symbol == MachO::INDIRECT_SYMBOL_LOCAL) { in PrintIndirectSymbolTable()
646 (MachO::INDIRECT_SYMBOL_LOCAL | MachO::INDIRECT_SYMBOL_ABS)) { in PrintIndirectSymbolTable()
650 if (indirect_symbol == MachO::INDIRECT_SYMBOL_ABS) { in PrintIndirectSymbolTable()
656 MachO::symtab_command Symtab = O->getSymtabLoadCommand(); in PrintIndirectSymbolTable()
671 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in PrintIndirectSymbols()
672 MachO::segment_command_64 Seg = O->getSegment64LoadCommand(Load); in PrintIndirectSymbols()
674 MachO::section_64 Sec = O->getSection64(Load, J); in PrintIndirectSymbols()
675 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in PrintIndirectSymbols()
676 if (section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
677 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
678 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in PrintIndirectSymbols()
679 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in PrintIndirectSymbols()
680 section_type == MachO::S_SYMBOL_STUBS) { in PrintIndirectSymbols()
682 if (section_type == MachO::S_SYMBOL_STUBS) in PrintIndirectSymbols()
699 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in PrintIndirectSymbols()
700 MachO::segment_command Seg = O->getSegmentLoadCommand(Load); in PrintIndirectSymbols()
702 MachO::section Sec = O->getSection(Load, J); in PrintIndirectSymbols()
703 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in PrintIndirectSymbols()
704 if (section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
705 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in PrintIndirectSymbols()
706 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in PrintIndirectSymbols()
707 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in PrintIndirectSymbols()
708 section_type == MachO::S_SYMBOL_STUBS) { in PrintIndirectSymbols()
710 if (section_type == MachO::S_SYMBOL_STUBS) in PrintIndirectSymbols()
758 case MachO::CPU_TYPE_I386: in PrintRType()
761 case MachO::CPU_TYPE_X86_64: in PrintRType()
764 case MachO::CPU_TYPE_ARM: in PrintRType()
767 case MachO::CPU_TYPE_ARM64: in PrintRType()
768 case MachO::CPU_TYPE_ARM64_32: in PrintRType()
778 if (cputype == MachO::CPU_TYPE_ARM && in PrintRLength()
779 (r_type == MachO::ARM_RELOC_HALF || in PrintRLength()
780 r_type == MachO::ARM_RELOC_HALF_SECTDIFF || previous_arm_half == true)) { in PrintRLength()
801 if (cputype == MachO::CPU_TYPE_X86_64) in PrintRLength()
817 const MachO::symtab_command Symtab = O->getSymtabLoadCommand(); in PrintRelocationEntries()
824 const MachO::any_relocation_info RE = O->getRelocation(Rel); in PrintRelocationEntries()
837 if (r_scattered && cputype != MachO::CPU_TYPE_X86_64) { in PrintRelocationEntries()
840 if ((cputype == MachO::CPU_TYPE_I386 && in PrintRelocationEntries()
841 r_type == MachO::GENERIC_RELOC_PAIR) || in PrintRelocationEntries()
842 (cputype == MachO::CPU_TYPE_ARM && r_type == MachO::ARM_RELOC_PAIR)) in PrintRelocationEntries()
863 if ((cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
864 r_type == MachO::ARM_RELOC_PAIR)) in PrintRelocationEntries()
866 } else if (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
867 sectdiff_r_type == MachO::ARM_RELOC_HALF_SECTDIFF) in PrintRelocationEntries()
869 if ((cputype == MachO::CPU_TYPE_I386 && in PrintRelocationEntries()
870 (r_type == MachO::GENERIC_RELOC_SECTDIFF || in PrintRelocationEntries()
871 r_type == MachO::GENERIC_RELOC_LOCAL_SECTDIFF)) || in PrintRelocationEntries()
872 (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
873 (sectdiff_r_type == MachO::ARM_RELOC_SECTDIFF || in PrintRelocationEntries()
874 sectdiff_r_type == MachO::ARM_RELOC_LOCAL_SECTDIFF || in PrintRelocationEntries()
875 sectdiff_r_type == MachO::ARM_RELOC_HALF_SECTDIFF))) { in PrintRelocationEntries()
882 if (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
883 (r_type == MachO::ARM_RELOC_HALF || in PrintRelocationEntries()
884 r_type == MachO::ARM_RELOC_HALF_SECTDIFF)) in PrintRelocationEntries()
900 if (cputype == MachO::CPU_TYPE_ARM && r_type == MachO::ARM_RELOC_PAIR) in PrintRelocationEntries()
942 if (cputype == MachO::CPU_TYPE_ARM && r_type == MachO::ARM_RELOC_PAIR) in PrintRelocationEntries()
944 else if ((cputype == MachO::CPU_TYPE_ARM64 || in PrintRelocationEntries()
945 cputype == MachO::CPU_TYPE_ARM64_32) && in PrintRelocationEntries()
946 r_type == MachO::ARM64_RELOC_ADDEND) in PrintRelocationEntries()
950 if (r_symbolnum == MachO::R_ABS) in PrintRelocationEntries()
970 if (cputype == MachO::CPU_TYPE_ARM && in PrintRelocationEntries()
971 (r_type == MachO::ARM_RELOC_HALF || in PrintRelocationEntries()
972 r_type == MachO::ARM_RELOC_HALF_SECTDIFF)) in PrintRelocationEntries()
989 const MachO::dysymtab_command Dysymtab = O->getDysymtabLoadCommand(); in PrintRelocations()
1007 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in PrintRelocations()
1008 const MachO::segment_command_64 Seg = O->getSegment64LoadCommand(Load); in PrintRelocations()
1010 const MachO::section_64 Sec = O->getSection64(Load, J); in PrintRelocations()
1027 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in PrintRelocations()
1028 const MachO::segment_command Seg = O->getSegmentLoadCommand(Load); in PrintRelocations()
1030 const MachO::section Sec = O->getSection(Load, J); in PrintRelocations()
1054 if (Command.C.cmd == MachO::LC_SEGMENT) { in PrintFunctionStarts()
1055 MachO::segment_command SLC = O->getSegmentLoadCommand(Command); in PrintFunctionStarts()
1060 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in PrintFunctionStarts()
1061 MachO::segment_command_64 SLC = O->getSegment64LoadCommand(Command); in PrintFunctionStarts()
1071 if (LC.C.cmd == MachO::LC_FUNCTION_STARTS) { in PrintFunctionStarts()
1072 MachO::linkedit_data_command FunctionStartsLC = in PrintFunctionStarts()
1089 MachO::linkedit_data_command DIC = O->getDataInCodeLoadCommand(); in PrintDataInCodeTable()
1090 uint32_t nentries = DIC.datasize / sizeof(struct MachO::data_in_code_entry); in PrintDataInCodeTable()
1105 case MachO::DICE_KIND_DATA: in PrintDataInCodeTable()
1108 case MachO::DICE_KIND_JUMP_TABLE8: in PrintDataInCodeTable()
1111 case MachO::DICE_KIND_JUMP_TABLE16: in PrintDataInCodeTable()
1114 case MachO::DICE_KIND_JUMP_TABLE32: in PrintDataInCodeTable()
1117 case MachO::DICE_KIND_ABS_JUMP_TABLE32: in PrintDataInCodeTable()
1131 MachO::linkedit_data_command LohLC = O->getLinkOptHintsLoadCommand(); in PrintLinkOptHints()
1204 if ((JustId && Load.C.cmd == MachO::LC_ID_DYLIB) || in PrintDylibs()
1205 (!JustId && (Load.C.cmd == MachO::LC_ID_DYLIB || in PrintDylibs()
1206 Load.C.cmd == MachO::LC_LOAD_DYLIB || in PrintDylibs()
1207 Load.C.cmd == MachO::LC_LOAD_WEAK_DYLIB || in PrintDylibs()
1208 Load.C.cmd == MachO::LC_REEXPORT_DYLIB || in PrintDylibs()
1209 Load.C.cmd == MachO::LC_LAZY_LOAD_DYLIB || in PrintDylibs()
1210 Load.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB))) { in PrintDylibs()
1211 MachO::dylib_command dl = O->getDylibIDLoadCommand(Load); in PrintDylibs()
1226 if (Load.C.cmd == MachO::LC_LOAD_WEAK_DYLIB) in PrintDylibs()
1228 if (Load.C.cmd == MachO::LC_REEXPORT_DYLIB) in PrintDylibs()
1230 if (Load.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB) in PrintDylibs()
1232 if (Load.C.cmd == MachO::LC_LAZY_LOAD_DYLIB) in PrintDylibs()
1238 if (Load.C.cmd == MachO::LC_ID_DYLIB) in PrintDylibs()
1240 else if (Load.C.cmd == MachO::LC_LOAD_DYLIB) in PrintDylibs()
1242 else if (Load.C.cmd == MachO::LC_LOAD_WEAK_DYLIB) in PrintDylibs()
1244 else if (Load.C.cmd == MachO::LC_LAZY_LOAD_DYLIB) in PrintDylibs()
1246 else if (Load.C.cmd == MachO::LC_REEXPORT_DYLIB) in PrintDylibs()
1248 else if (Load.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB) in PrintDylibs()
1260 if (Command.C.cmd == MachO::LC_RPATH) { in printRpaths()
1452 const MachO::section_64 Sec = O->getSection64(Ref); in DumpLiteralPointerSection()
1453 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1455 const MachO::section Sec = O->getSection(Ref); in DumpLiteralPointerSection()
1456 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1458 if (section_type == MachO::S_CSTRING_LITERALS || in DumpLiteralPointerSection()
1459 section_type == MachO::S_4BYTE_LITERALS || in DumpLiteralPointerSection()
1460 section_type == MachO::S_8BYTE_LITERALS || in DumpLiteralPointerSection()
1461 section_type == MachO::S_16BYTE_LITERALS) in DumpLiteralPointerSection()
1472 MachO::any_relocation_info RE; in DumpLiteralPointerSection()
1542 const MachO::section_64 Sec = O->getSection64(Ref); in DumpLiteralPointerSection()
1543 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1545 const MachO::section Sec = O->getSection(Ref); in DumpLiteralPointerSection()
1546 section_type = Sec.flags & MachO::SECTION_TYPE; in DumpLiteralPointerSection()
1554 case MachO::S_CSTRING_LITERALS: in DumpLiteralPointerSection()
1561 case MachO::S_4BYTE_LITERALS: in DumpLiteralPointerSection()
1572 case MachO::S_8BYTE_LITERALS: { in DumpLiteralPointerSection()
1587 case MachO::S_16BYTE_LITERALS: { in DumpLiteralPointerSection()
1622 MachO::any_relocation_info RE; in DumpInitTermPointerSection()
1676 if (cputype == MachO::CPU_TYPE_I386 || cputype == MachO::CPU_TYPE_X86_64) { in DumpRawSectionContents()
1763 const MachO::section_64 Sec = O->getSection64(Ref); in DumpSectionContents()
1767 const MachO::section Sec = O->getSection(Ref); in DumpSectionContents()
1770 uint32_t section_type = section_flags & MachO::SECTION_TYPE; in DumpSectionContents()
1783 if ((section_flags & MachO::S_ATTR_PURE_INSTRUCTIONS) || in DumpSectionContents()
1784 (section_flags & MachO::S_ATTR_SOME_INSTRUCTIONS)) { in DumpSectionContents()
1804 case MachO::S_REGULAR: in DumpSectionContents()
1807 case MachO::S_ZEROFILL: in DumpSectionContents()
1810 case MachO::S_CSTRING_LITERALS: in DumpSectionContents()
1813 case MachO::S_4BYTE_LITERALS: in DumpSectionContents()
1816 case MachO::S_8BYTE_LITERALS: in DumpSectionContents()
1819 case MachO::S_16BYTE_LITERALS: in DumpSectionContents()
1822 case MachO::S_LITERAL_POINTERS: in DumpSectionContents()
1826 case MachO::S_MOD_INIT_FUNC_POINTERS: in DumpSectionContents()
1827 case MachO::S_MOD_TERM_FUNC_POINTERS: in DumpSectionContents()
1838 if (section_type == MachO::S_ZEROFILL) in DumpSectionContents()
1878 auto *MachO = dyn_cast<MachOObjectFile>(O); in checkMachOAndArchFlags() local
1880 if (!MachO || ArchAll || ArchFlags.empty()) in checkMachOAndArchFlags()
1883 MachO::mach_header H; in checkMachOAndArchFlags()
1884 MachO::mach_header_64 H_64; in checkMachOAndArchFlags()
1887 if (MachO->is64Bit()) { in checkMachOAndArchFlags()
1888 H_64 = MachO->MachOObjectFile::getHeader64(); in checkMachOAndArchFlags()
1892 H = MachO->MachOObjectFile::getHeader(); in checkMachOAndArchFlags()
1965 if (MachOOF->getHeader().filetype == MachO::MH_KEXT_BUNDLE && in ProcessMachO()
1966 MachOOF->getHeader().cputype == MachO::CPU_TYPE_ARM64) in ProcessMachO()
2039 case MachO::CPU_TYPE_I386: in printCPUType()
2041 case MachO::CPU_SUBTYPE_I386_ALL: in printCPUType()
2050 case MachO::CPU_TYPE_X86_64: in printCPUType()
2052 case MachO::CPU_SUBTYPE_X86_64_ALL: in printCPUType()
2056 case MachO::CPU_SUBTYPE_X86_64_H: in printCPUType()
2065 case MachO::CPU_TYPE_ARM: in printCPUType()
2067 case MachO::CPU_SUBTYPE_ARM_ALL: in printCPUType()
2071 case MachO::CPU_SUBTYPE_ARM_V4T: in printCPUType()
2075 case MachO::CPU_SUBTYPE_ARM_V5TEJ: in printCPUType()
2079 case MachO::CPU_SUBTYPE_ARM_XSCALE: in printCPUType()
2083 case MachO::CPU_SUBTYPE_ARM_V6: in printCPUType()
2087 case MachO::CPU_SUBTYPE_ARM_V6M: in printCPUType()
2091 case MachO::CPU_SUBTYPE_ARM_V7: in printCPUType()
2095 case MachO::CPU_SUBTYPE_ARM_V7EM: in printCPUType()
2099 case MachO::CPU_SUBTYPE_ARM_V7K: in printCPUType()
2103 case MachO::CPU_SUBTYPE_ARM_V7M: in printCPUType()
2107 case MachO::CPU_SUBTYPE_ARM_V7S: in printCPUType()
2116 case MachO::CPU_TYPE_ARM64: in printCPUType()
2117 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in printCPUType()
2118 case MachO::CPU_SUBTYPE_ARM64_ALL: in printCPUType()
2122 case MachO::CPU_SUBTYPE_ARM64_V8: in printCPUType()
2126 case MachO::CPU_SUBTYPE_ARM64E: in printCPUType()
2135 case MachO::CPU_TYPE_ARM64_32: in printCPUType()
2136 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in printCPUType()
2137 case MachO::CPU_SUBTYPE_ARM64_32_V8: in printCPUType()
2156 if (UB->getMagic() == MachO::FAT_MAGIC) in printMachOUniversalHeaders()
2161 outs() << "fat_magic " << format("0x%" PRIx32, MachO::FAT_MAGIC) << "\n"; in printMachOUniversalHeaders()
2166 uint64_t big_size = sizeof(struct MachO::fat_header) + in printMachOUniversalHeaders()
2167 nfat_arch * sizeof(struct MachO::fat_arch); in printMachOUniversalHeaders()
2186 (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) == in printMachOUniversalHeaders()
2187 (other_cpusubtype & ~MachO::CPU_SUBTYPE_MASK)) { in printMachOUniversalHeaders()
2194 printCPUType(cputype, cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in printMachOUniversalHeaders()
2198 outs() << " cpusubtype " << (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) in printMachOUniversalHeaders()
2202 (cpusubtype & MachO::CPU_SUBTYPE_MASK) == MachO::CPU_SUBTYPE_LIB64) in printMachOUniversalHeaders()
2207 (cpusubtype & MachO::CPU_SUBTYPE_MASK) >> 24) << "\n"; in printMachOUniversalHeaders()
2631 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
2644 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2658 if (r_type == MachO::GENERIC_RELOC_SECTDIFF || in SymbolizerGetOpInfo()
2659 r_type == MachO::GENERIC_RELOC_LOCAL_SECTDIFF) { in SymbolizerGetOpInfo()
2662 MachO::any_relocation_info RENext; in SymbolizerGetOpInfo()
2688 if (reloc_found && (r_type == MachO::GENERIC_RELOC_SECTDIFF || in SymbolizerGetOpInfo()
2689 r_type == MachO::GENERIC_RELOC_LOCAL_SECTDIFF)) { in SymbolizerGetOpInfo()
2714 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
2718 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2756 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2783 if (Type == MachO::X86_64_RELOC_SUBTRACTOR) { in SymbolizerGetOpInfo()
2786 MachO::any_relocation_info RENext = info->O->getRelocation(RelNext); in SymbolizerGetOpInfo()
2790 if (TypeNext == MachO::X86_64_RELOC_UNSIGNED && isExternNext) { in SymbolizerGetOpInfo()
2809 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
2821 MachO::any_relocation_info RE; in SymbolizerGetOpInfo()
2850 if (r_type == MachO::ARM_RELOC_HALF || in SymbolizerGetOpInfo()
2851 r_type == MachO::ARM_RELOC_SECTDIFF || in SymbolizerGetOpInfo()
2852 r_type == MachO::ARM_RELOC_LOCAL_SECTDIFF || in SymbolizerGetOpInfo()
2853 r_type == MachO::ARM_RELOC_HALF_SECTDIFF) { in SymbolizerGetOpInfo()
2856 MachO::any_relocation_info RENext; in SymbolizerGetOpInfo()
2869 case MachO::ARM_RELOC_HALF: in SymbolizerGetOpInfo()
2887 if (isExtern == 0 && (r_type == MachO::ARM_RELOC_BR24 || in SymbolizerGetOpInfo()
2888 r_type == MachO::ARM_THUMB_RELOC_BR22)) in SymbolizerGetOpInfo()
2892 if (r_type == MachO::ARM_RELOC_HALF || in SymbolizerGetOpInfo()
2893 r_type == MachO::ARM_RELOC_HALF_SECTDIFF) { in SymbolizerGetOpInfo()
2899 if (r_scattered && (r_type != MachO::ARM_RELOC_HALF && in SymbolizerGetOpInfo()
2900 r_type != MachO::ARM_RELOC_HALF_SECTDIFF)) { in SymbolizerGetOpInfo()
2905 if (r_type == MachO::ARM_RELOC_HALF_SECTDIFF) { in SymbolizerGetOpInfo()
2929 if (r_type == MachO::ARM_RELOC_HALF) { in SymbolizerGetOpInfo()
2946 if (info->O->getHeader().filetype != MachO::MH_OBJECT) { in SymbolizerGetOpInfo()
2967 MachO::any_relocation_info RE = info->O->getRelocation(Rel); in SymbolizerGetOpInfo()
2969 if (r_type == MachO::ARM64_RELOC_ADDEND) { in SymbolizerGetOpInfo()
2972 MachO::any_relocation_info RENext = info->O->getRelocation(RelNext); in SymbolizerGetOpInfo()
2988 case MachO::ARM64_RELOC_PAGE21: in SymbolizerGetOpInfo()
2992 case MachO::ARM64_RELOC_PAGEOFF12: in SymbolizerGetOpInfo()
2996 case MachO::ARM64_RELOC_GOT_LOAD_PAGE21: in SymbolizerGetOpInfo()
3000 case MachO::ARM64_RELOC_GOT_LOAD_PAGEOFF12: in SymbolizerGetOpInfo()
3004 case MachO::ARM64_RELOC_TLVP_LOAD_PAGE21: in SymbolizerGetOpInfo()
3008 case MachO::ARM64_RELOC_TLVP_LOAD_PAGEOFF12: in SymbolizerGetOpInfo()
3013 case MachO::ARM64_RELOC_BRANCH26: in SymbolizerGetOpInfo()
3028 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in GuessCstringPointer()
3029 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load); in GuessCstringPointer()
3031 MachO::section_64 Sec = info->O->getSection64(Load, J); in GuessCstringPointer()
3032 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessCstringPointer()
3033 if (section_type == MachO::S_CSTRING_LITERALS && in GuessCstringPointer()
3049 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in GuessCstringPointer()
3050 MachO::segment_command Seg = info->O->getSegmentLoadCommand(Load); in GuessCstringPointer()
3052 MachO::section Sec = info->O->getSection(Load, J); in GuessCstringPointer()
3053 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessCstringPointer()
3054 if (section_type == MachO::S_CSTRING_LITERALS && in GuessCstringPointer()
3081 MachO::dysymtab_command Dysymtab = info->O->getDysymtabLoadCommand(); in GuessIndirectSymbol()
3082 MachO::symtab_command Symtab = info->O->getSymtabLoadCommand(); in GuessIndirectSymbol()
3084 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in GuessIndirectSymbol()
3085 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load); in GuessIndirectSymbol()
3087 MachO::section_64 Sec = info->O->getSection64(Load, J); in GuessIndirectSymbol()
3088 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessIndirectSymbol()
3089 if ((section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3090 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3091 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in GuessIndirectSymbol()
3092 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in GuessIndirectSymbol()
3093 section_type == MachO::S_SYMBOL_STUBS) && in GuessIndirectSymbol()
3097 if (section_type == MachO::S_SYMBOL_STUBS) in GuessIndirectSymbol()
3115 } else if (Load.C.cmd == MachO::LC_SEGMENT) { in GuessIndirectSymbol()
3116 MachO::segment_command Seg = info->O->getSegmentLoadCommand(Load); in GuessIndirectSymbol()
3118 MachO::section Sec = info->O->getSection(Load, J); in GuessIndirectSymbol()
3119 uint32_t section_type = Sec.flags & MachO::SECTION_TYPE; in GuessIndirectSymbol()
3120 if ((section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3121 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in GuessIndirectSymbol()
3122 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in GuessIndirectSymbol()
3123 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS || in GuessIndirectSymbol()
3124 section_type == MachO::S_SYMBOL_STUBS) && in GuessIndirectSymbol()
3128 if (section_type == MachO::S_SYMBOL_STUBS) in GuessIndirectSymbol()
3235 if (Load.C.cmd == MachO::LC_SEGMENT_64) { in GuessPointerPointer()
3236 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load); in GuessPointerPointer()
3238 MachO::section_64 Sec = info->O->getSection64(Load, J); in GuessPointerPointer()
3348 MachO::any_relocation_info RE; in get_symbol_64()
6855 MachO::mach_header H; in printObjcMetaData()
6857 if (H.cputype == MachO::CPU_TYPE_ARM) in printObjcMetaData()
6894 if (info->O->getHeader().filetype == MachO::MH_OBJECT) { in GuessLiteralPointer()
6899 MachO::any_relocation_info RE; in GuessLiteralPointer()
6923 if (Type == MachO::X86_64_RELOC_SIGNED) { in GuessLiteralPointer()
7329 MachO::mach_header Header = MachOOF->getHeader(); in DisassembleMachO()
7348 if (Header.filetype == MachO::MH_OBJECT) in DisassembleMachO()
7420 const MachO::mach_header_64 H_64 = MachOOF->getHeader64(); in DisassembleMachO()
7424 const MachO::mach_header H = MachOOF->getHeader(); in DisassembleMachO()
8280 if (magic == MachO::MH_MAGIC) in PrintMachHeader()
8282 else if (magic == MachO::MH_MAGIC_64) in PrintMachHeader()
8287 case MachO::CPU_TYPE_I386: in PrintMachHeader()
8289 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8290 case MachO::CPU_SUBTYPE_I386_ALL: in PrintMachHeader()
8294 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8298 case MachO::CPU_TYPE_X86_64: in PrintMachHeader()
8300 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8301 case MachO::CPU_SUBTYPE_X86_64_ALL: in PrintMachHeader()
8304 case MachO::CPU_SUBTYPE_X86_64_H: in PrintMachHeader()
8308 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8312 case MachO::CPU_TYPE_ARM: in PrintMachHeader()
8314 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8315 case MachO::CPU_SUBTYPE_ARM_ALL: in PrintMachHeader()
8318 case MachO::CPU_SUBTYPE_ARM_V4T: in PrintMachHeader()
8321 case MachO::CPU_SUBTYPE_ARM_V5TEJ: in PrintMachHeader()
8324 case MachO::CPU_SUBTYPE_ARM_XSCALE: in PrintMachHeader()
8327 case MachO::CPU_SUBTYPE_ARM_V6: in PrintMachHeader()
8330 case MachO::CPU_SUBTYPE_ARM_V6M: in PrintMachHeader()
8333 case MachO::CPU_SUBTYPE_ARM_V7: in PrintMachHeader()
8336 case MachO::CPU_SUBTYPE_ARM_V7EM: in PrintMachHeader()
8339 case MachO::CPU_SUBTYPE_ARM_V7K: in PrintMachHeader()
8342 case MachO::CPU_SUBTYPE_ARM_V7M: in PrintMachHeader()
8345 case MachO::CPU_SUBTYPE_ARM_V7S: in PrintMachHeader()
8349 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8353 case MachO::CPU_TYPE_ARM64: in PrintMachHeader()
8355 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8356 case MachO::CPU_SUBTYPE_ARM64_ALL: in PrintMachHeader()
8359 case MachO::CPU_SUBTYPE_ARM64_V8: in PrintMachHeader()
8362 case MachO::CPU_SUBTYPE_ARM64E: in PrintMachHeader()
8366 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8370 case MachO::CPU_TYPE_ARM64_32: in PrintMachHeader()
8372 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8373 case MachO::CPU_SUBTYPE_ARM64_32_V8: in PrintMachHeader()
8377 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8381 case MachO::CPU_TYPE_POWERPC: in PrintMachHeader()
8383 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8384 case MachO::CPU_SUBTYPE_POWERPC_ALL: in PrintMachHeader()
8388 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8392 case MachO::CPU_TYPE_POWERPC64: in PrintMachHeader()
8394 switch (cpusubtype & ~MachO::CPU_SUBTYPE_MASK) { in PrintMachHeader()
8395 case MachO::CPU_SUBTYPE_POWERPC_ALL: in PrintMachHeader()
8399 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8405 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8408 if ((cpusubtype & MachO::CPU_SUBTYPE_MASK) == MachO::CPU_SUBTYPE_LIB64) { in PrintMachHeader()
8412 (cpusubtype & MachO::CPU_SUBTYPE_MASK) >> 24); in PrintMachHeader()
8415 case MachO::MH_OBJECT: in PrintMachHeader()
8418 case MachO::MH_EXECUTE: in PrintMachHeader()
8421 case MachO::MH_FVMLIB: in PrintMachHeader()
8424 case MachO::MH_CORE: in PrintMachHeader()
8427 case MachO::MH_PRELOAD: in PrintMachHeader()
8430 case MachO::MH_DYLIB: in PrintMachHeader()
8433 case MachO::MH_DYLIB_STUB: in PrintMachHeader()
8436 case MachO::MH_DYLINKER: in PrintMachHeader()
8439 case MachO::MH_BUNDLE: in PrintMachHeader()
8442 case MachO::MH_DSYM: in PrintMachHeader()
8445 case MachO::MH_KEXT_BUNDLE: in PrintMachHeader()
8455 if (f & MachO::MH_NOUNDEFS) { in PrintMachHeader()
8457 f &= ~MachO::MH_NOUNDEFS; in PrintMachHeader()
8459 if (f & MachO::MH_INCRLINK) { in PrintMachHeader()
8461 f &= ~MachO::MH_INCRLINK; in PrintMachHeader()
8463 if (f & MachO::MH_DYLDLINK) { in PrintMachHeader()
8465 f &= ~MachO::MH_DYLDLINK; in PrintMachHeader()
8467 if (f & MachO::MH_BINDATLOAD) { in PrintMachHeader()
8469 f &= ~MachO::MH_BINDATLOAD; in PrintMachHeader()
8471 if (f & MachO::MH_PREBOUND) { in PrintMachHeader()
8473 f &= ~MachO::MH_PREBOUND; in PrintMachHeader()
8475 if (f & MachO::MH_SPLIT_SEGS) { in PrintMachHeader()
8477 f &= ~MachO::MH_SPLIT_SEGS; in PrintMachHeader()
8479 if (f & MachO::MH_LAZY_INIT) { in PrintMachHeader()
8481 f &= ~MachO::MH_LAZY_INIT; in PrintMachHeader()
8483 if (f & MachO::MH_TWOLEVEL) { in PrintMachHeader()
8485 f &= ~MachO::MH_TWOLEVEL; in PrintMachHeader()
8487 if (f & MachO::MH_FORCE_FLAT) { in PrintMachHeader()
8489 f &= ~MachO::MH_FORCE_FLAT; in PrintMachHeader()
8491 if (f & MachO::MH_NOMULTIDEFS) { in PrintMachHeader()
8493 f &= ~MachO::MH_NOMULTIDEFS; in PrintMachHeader()
8495 if (f & MachO::MH_NOFIXPREBINDING) { in PrintMachHeader()
8497 f &= ~MachO::MH_NOFIXPREBINDING; in PrintMachHeader()
8499 if (f & MachO::MH_PREBINDABLE) { in PrintMachHeader()
8501 f &= ~MachO::MH_PREBINDABLE; in PrintMachHeader()
8503 if (f & MachO::MH_ALLMODSBOUND) { in PrintMachHeader()
8505 f &= ~MachO::MH_ALLMODSBOUND; in PrintMachHeader()
8507 if (f & MachO::MH_SUBSECTIONS_VIA_SYMBOLS) { in PrintMachHeader()
8509 f &= ~MachO::MH_SUBSECTIONS_VIA_SYMBOLS; in PrintMachHeader()
8511 if (f & MachO::MH_CANONICAL) { in PrintMachHeader()
8513 f &= ~MachO::MH_CANONICAL; in PrintMachHeader()
8515 if (f & MachO::MH_WEAK_DEFINES) { in PrintMachHeader()
8517 f &= ~MachO::MH_WEAK_DEFINES; in PrintMachHeader()
8519 if (f & MachO::MH_BINDS_TO_WEAK) { in PrintMachHeader()
8521 f &= ~MachO::MH_BINDS_TO_WEAK; in PrintMachHeader()
8523 if (f & MachO::MH_ALLOW_STACK_EXECUTION) { in PrintMachHeader()
8525 f &= ~MachO::MH_ALLOW_STACK_EXECUTION; in PrintMachHeader()
8527 if (f & MachO::MH_DEAD_STRIPPABLE_DYLIB) { in PrintMachHeader()
8529 f &= ~MachO::MH_DEAD_STRIPPABLE_DYLIB; in PrintMachHeader()
8531 if (f & MachO::MH_PIE) { in PrintMachHeader()
8533 f &= ~MachO::MH_PIE; in PrintMachHeader()
8535 if (f & MachO::MH_NO_REEXPORTED_DYLIBS) { in PrintMachHeader()
8537 f &= ~MachO::MH_NO_REEXPORTED_DYLIBS; in PrintMachHeader()
8539 if (f & MachO::MH_HAS_TLV_DESCRIPTORS) { in PrintMachHeader()
8541 f &= ~MachO::MH_HAS_TLV_DESCRIPTORS; in PrintMachHeader()
8543 if (f & MachO::MH_NO_HEAP_EXECUTION) { in PrintMachHeader()
8545 f &= ~MachO::MH_NO_HEAP_EXECUTION; in PrintMachHeader()
8547 if (f & MachO::MH_APP_EXTENSION_SAFE) { in PrintMachHeader()
8549 f &= ~MachO::MH_APP_EXTENSION_SAFE; in PrintMachHeader()
8551 if (f & MachO::MH_NLIST_OUTOFSYNC_WITH_DYLDINFO) { in PrintMachHeader()
8553 f &= ~MachO::MH_NLIST_OUTOFSYNC_WITH_DYLDINFO; in PrintMachHeader()
8560 outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); in PrintMachHeader()
8562 (cpusubtype & MachO::CPU_SUBTYPE_MASK) >> 24); in PrintMachHeader()
8579 if (cmd == MachO::LC_SEGMENT) { in PrintSegmentCommand()
8582 expected_cmdsize *= sizeof(struct MachO::section); in PrintSegmentCommand()
8583 expected_cmdsize += sizeof(struct MachO::segment_command); in PrintSegmentCommand()
8587 expected_cmdsize *= sizeof(struct MachO::section_64); in PrintSegmentCommand()
8588 expected_cmdsize += sizeof(struct MachO::segment_command_64); in PrintSegmentCommand()
8596 if (cmd == MachO::LC_SEGMENT_64) { in PrintSegmentCommand()
8615 ~(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | in PrintSegmentCommand()
8616 MachO::VM_PROT_EXECUTE)) != 0) in PrintSegmentCommand()
8620 outs() << ((maxprot & MachO::VM_PROT_READ) ? "r" : "-"); in PrintSegmentCommand()
8621 outs() << ((maxprot & MachO::VM_PROT_WRITE) ? "w" : "-"); in PrintSegmentCommand()
8622 outs() << ((maxprot & MachO::VM_PROT_EXECUTE) ? "x\n" : "-\n"); in PrintSegmentCommand()
8625 ~(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | in PrintSegmentCommand()
8626 MachO::VM_PROT_EXECUTE)) != 0) in PrintSegmentCommand()
8630 outs() << ((initprot & MachO::VM_PROT_READ) ? "r" : "-"); in PrintSegmentCommand()
8631 outs() << ((initprot & MachO::VM_PROT_WRITE) ? "w" : "-"); in PrintSegmentCommand()
8632 outs() << ((initprot & MachO::VM_PROT_EXECUTE) ? "x\n" : "-\n"); in PrintSegmentCommand()
8644 if (flags & MachO::SG_HIGHVM) { in PrintSegmentCommand()
8646 flags &= ~MachO::SG_HIGHVM; in PrintSegmentCommand()
8648 if (flags & MachO::SG_FVMLIB) { in PrintSegmentCommand()
8650 flags &= ~MachO::SG_FVMLIB; in PrintSegmentCommand()
8652 if (flags & MachO::SG_NORELOC) { in PrintSegmentCommand()
8654 flags &= ~MachO::SG_NORELOC; in PrintSegmentCommand()
8656 if (flags & MachO::SG_PROTECTED_VERSION_1) { in PrintSegmentCommand()
8658 flags &= ~MachO::SG_PROTECTED_VERSION_1; in PrintSegmentCommand()
8680 if (filetype != MachO::MH_OBJECT && strncmp(sg_segname, segname, 16) != 0) in PrintSection()
8684 if (cmd == MachO::LC_SEGMENT_64) { in PrintSection()
8691 if ((flags & MachO::S_ZEROFILL) != 0 && offset + size > object_size) in PrintSection()
8708 if (reloff + nreloc * sizeof(struct MachO::relocation_info) > object_size) in PrintSection()
8712 uint32_t section_type = flags & MachO::SECTION_TYPE; in PrintSection()
8715 if (section_type == MachO::S_REGULAR) in PrintSection()
8717 else if (section_type == MachO::S_ZEROFILL) in PrintSection()
8719 else if (section_type == MachO::S_CSTRING_LITERALS) in PrintSection()
8721 else if (section_type == MachO::S_4BYTE_LITERALS) in PrintSection()
8723 else if (section_type == MachO::S_8BYTE_LITERALS) in PrintSection()
8725 else if (section_type == MachO::S_16BYTE_LITERALS) in PrintSection()
8727 else if (section_type == MachO::S_LITERAL_POINTERS) in PrintSection()
8729 else if (section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS) in PrintSection()
8731 else if (section_type == MachO::S_LAZY_SYMBOL_POINTERS) in PrintSection()
8733 else if (section_type == MachO::S_SYMBOL_STUBS) in PrintSection()
8735 else if (section_type == MachO::S_MOD_INIT_FUNC_POINTERS) in PrintSection()
8737 else if (section_type == MachO::S_MOD_TERM_FUNC_POINTERS) in PrintSection()
8739 else if (section_type == MachO::S_COALESCED) in PrintSection()
8741 else if (section_type == MachO::S_INTERPOSING) in PrintSection()
8743 else if (section_type == MachO::S_DTRACE_DOF) in PrintSection()
8745 else if (section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS) in PrintSection()
8747 else if (section_type == MachO::S_THREAD_LOCAL_REGULAR) in PrintSection()
8749 else if (section_type == MachO::S_THREAD_LOCAL_ZEROFILL) in PrintSection()
8751 else if (section_type == MachO::S_THREAD_LOCAL_VARIABLES) in PrintSection()
8753 else if (section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS) in PrintSection()
8755 else if (section_type == MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS) in PrintSection()
8760 uint32_t section_attributes = flags & MachO::SECTION_ATTRIBUTES; in PrintSection()
8761 if (section_attributes & MachO::S_ATTR_PURE_INSTRUCTIONS) in PrintSection()
8763 if (section_attributes & MachO::S_ATTR_NO_TOC) in PrintSection()
8765 if (section_attributes & MachO::S_ATTR_STRIP_STATIC_SYMS) in PrintSection()
8767 if (section_attributes & MachO::S_ATTR_NO_DEAD_STRIP) in PrintSection()
8769 if (section_attributes & MachO::S_ATTR_LIVE_SUPPORT) in PrintSection()
8771 if (section_attributes & MachO::S_ATTR_SELF_MODIFYING_CODE) in PrintSection()
8773 if (section_attributes & MachO::S_ATTR_DEBUG) in PrintSection()
8775 if (section_attributes & MachO::S_ATTR_SOME_INSTRUCTIONS) in PrintSection()
8777 if (section_attributes & MachO::S_ATTR_EXT_RELOC) in PrintSection()
8779 if (section_attributes & MachO::S_ATTR_LOC_RELOC) in PrintSection()
8787 if (section_type == MachO::S_SYMBOL_STUBS || in PrintSection()
8788 section_type == MachO::S_LAZY_SYMBOL_POINTERS || in PrintSection()
8789 section_type == MachO::S_LAZY_DYLIB_SYMBOL_POINTERS || in PrintSection()
8790 section_type == MachO::S_NON_LAZY_SYMBOL_POINTERS || in PrintSection()
8791 section_type == MachO::S_THREAD_LOCAL_VARIABLE_POINTERS) in PrintSection()
8796 if (section_type == MachO::S_SYMBOL_STUBS) in PrintSection()
8802 static void PrintSymtabLoadCommand(MachO::symtab_command st, bool Is64Bit, in PrintSymtabLoadCommand()
8806 if (st.cmdsize != sizeof(struct MachO::symtab_command)) in PrintSymtabLoadCommand()
8819 big_size *= sizeof(struct MachO::nlist_64); in PrintSymtabLoadCommand()
8827 big_size *= sizeof(struct MachO::nlist); in PrintSymtabLoadCommand()
8848 static void PrintDysymtabLoadCommand(MachO::dysymtab_command dyst, in PrintDysymtabLoadCommand()
8853 if (dyst.cmdsize != sizeof(struct MachO::dysymtab_command)) in PrintDysymtabLoadCommand()
8901 big_size *= sizeof(struct MachO::dylib_table_of_contents); in PrintDysymtabLoadCommand()
8916 modtabend *= sizeof(struct MachO::dylib_module_64); in PrintDysymtabLoadCommand()
8920 modtabend *= sizeof(struct MachO::dylib_module); in PrintDysymtabLoadCommand()
8934 big_size *= sizeof(struct MachO::dylib_reference); in PrintDysymtabLoadCommand()
8960 big_size *= sizeof(struct MachO::relocation_info); in PrintDysymtabLoadCommand()
8973 big_size *= sizeof(struct MachO::relocation_info); in PrintDysymtabLoadCommand()
8981 static void PrintDyldInfoLoadCommand(MachO::dyld_info_command dc, in PrintDyldInfoLoadCommand()
8983 if (dc.cmd == MachO::LC_DYLD_INFO) in PrintDyldInfoLoadCommand()
8988 if (dc.cmdsize != sizeof(struct MachO::dyld_info_command)) in PrintDyldInfoLoadCommand()
9055 static void PrintDyldLoadCommand(MachO::dylinker_command dyld, in PrintDyldLoadCommand()
9057 if (dyld.cmd == MachO::LC_ID_DYLINKER) in PrintDyldLoadCommand()
9059 else if (dyld.cmd == MachO::LC_LOAD_DYLINKER) in PrintDyldLoadCommand()
9061 else if (dyld.cmd == MachO::LC_DYLD_ENVIRONMENT) in PrintDyldLoadCommand()
9066 if (dyld.cmdsize < sizeof(struct MachO::dylinker_command)) in PrintDyldLoadCommand()
9078 static void PrintUuidLoadCommand(MachO::uuid_command uuid) { in PrintUuidLoadCommand()
9081 if (uuid.cmdsize != sizeof(struct MachO::uuid_command)) in PrintUuidLoadCommand()
9094 static void PrintRpathLoadCommand(MachO::rpath_command rpath, const char *Ptr) { in PrintRpathLoadCommand()
9097 if (rpath.cmdsize < sizeof(struct MachO::rpath_command)) in PrintRpathLoadCommand()
9109 static void PrintVersionMinLoadCommand(MachO::version_min_command vd) { in PrintVersionMinLoadCommand()
9112 case MachO::LC_VERSION_MIN_MACOSX: in PrintVersionMinLoadCommand()
9115 case MachO::LC_VERSION_MIN_IPHONEOS: in PrintVersionMinLoadCommand()
9118 case MachO::LC_VERSION_MIN_TVOS: in PrintVersionMinLoadCommand()
9121 case MachO::LC_VERSION_MIN_WATCHOS: in PrintVersionMinLoadCommand()
9130 if (vd.cmdsize != sizeof(struct MachO::version_min_command)) in PrintVersionMinLoadCommand()
9154 static void PrintNoteLoadCommand(MachO::note_command Nt) { in PrintNoteLoadCommand()
9157 if (Nt.cmdsize != sizeof(struct MachO::note_command)) in PrintNoteLoadCommand()
9167 static void PrintBuildToolVersion(MachO::build_tool_version bv, bool verbose) { in PrintBuildToolVersion()
9179 MachO::build_version_command bd, in PrintBuildVersionLoadCommand()
9184 sizeof(struct MachO::build_version_command) + in PrintBuildVersionLoadCommand()
9185 bd.ntools * sizeof(struct MachO::build_tool_version)) in PrintBuildVersionLoadCommand()
9204 MachO::build_tool_version bv = obj->getBuildToolVersion(i); in PrintBuildVersionLoadCommand()
9209 static void PrintSourceVersionCommand(MachO::source_version_command sd) { in PrintSourceVersionCommand()
9212 if (sd.cmdsize != sizeof(struct MachO::source_version_command)) in PrintSourceVersionCommand()
9231 static void PrintEntryPointCommand(MachO::entry_point_command ep) { in PrintEntryPointCommand()
9234 if (ep.cmdsize != sizeof(struct MachO::entry_point_command)) in PrintEntryPointCommand()
9242 static void PrintEncryptionInfoCommand(MachO::encryption_info_command ec, in PrintEncryptionInfoCommand()
9246 if (ec.cmdsize != sizeof(struct MachO::encryption_info_command)) in PrintEncryptionInfoCommand()
9263 static void PrintEncryptionInfoCommand64(MachO::encryption_info_command_64 ec, in PrintEncryptionInfoCommand64()
9267 if (ec.cmdsize != sizeof(struct MachO::encryption_info_command_64)) in PrintEncryptionInfoCommand64()
9285 static void PrintLinkerOptionCommand(MachO::linker_option_command lo, in PrintLinkerOptionCommand()
9289 if (lo.cmdsize < sizeof(struct MachO::linker_option_command)) in PrintLinkerOptionCommand()
9294 const char *string = Ptr + sizeof(struct MachO::linker_option_command); in PrintLinkerOptionCommand()
9295 uint32_t left = lo.cmdsize - sizeof(struct MachO::linker_option_command); in PrintLinkerOptionCommand()
9316 static void PrintSubFrameworkCommand(MachO::sub_framework_command sub, in PrintSubFrameworkCommand()
9320 if (sub.cmdsize < sizeof(struct MachO::sub_framework_command)) in PrintSubFrameworkCommand()
9332 static void PrintSubUmbrellaCommand(MachO::sub_umbrella_command sub, in PrintSubUmbrellaCommand()
9336 if (sub.cmdsize < sizeof(struct MachO::sub_umbrella_command)) in PrintSubUmbrellaCommand()
9348 static void PrintSubLibraryCommand(MachO::sub_library_command sub, in PrintSubLibraryCommand()
9352 if (sub.cmdsize < sizeof(struct MachO::sub_library_command)) in PrintSubLibraryCommand()
9364 static void PrintSubClientCommand(MachO::sub_client_command sub, in PrintSubClientCommand()
9368 if (sub.cmdsize < sizeof(struct MachO::sub_client_command)) in PrintSubClientCommand()
9380 static void PrintRoutinesCommand(MachO::routines_command r) { in PrintRoutinesCommand()
9383 if (r.cmdsize != sizeof(struct MachO::routines_command)) in PrintRoutinesCommand()
9397 static void PrintRoutinesCommand64(MachO::routines_command_64 r) { in PrintRoutinesCommand64()
9400 if (r.cmdsize != sizeof(struct MachO::routines_command_64)) in PrintRoutinesCommand64()
9414 static void Print_x86_thread_state32_t(MachO::x86_thread_state32_t &cpu32) { in Print_x86_thread_state32_t()
9433 static void Print_x86_thread_state64_t(MachO::x86_thread_state64_t &cpu64) { in Print_x86_thread_state64_t()
9457 static void Print_mmst_reg(MachO::mmst_reg_t &r) { in Print_mmst_reg()
9469 static void Print_xmm_reg(MachO::xmm_reg_t &r) { in Print_xmm_reg()
9477 static void Print_x86_float_state_t(MachO::x86_float_state64_t &fpu) { in Print_x86_float_state_t()
9487 if (fpu.fpu_fcw.pc == MachO::x86_FP_PREC_24B) in Print_x86_float_state_t()
9489 else if (fpu.fpu_fcw.pc == MachO::x86_FP_PREC_53B) in Print_x86_float_state_t()
9491 else if (fpu.fpu_fcw.pc == MachO::x86_FP_PREC_64B) in Print_x86_float_state_t()
9496 if (fpu.fpu_fcw.rc == MachO::x86_FP_RND_NEAR) in Print_x86_float_state_t()
9498 else if (fpu.fpu_fcw.rc == MachO::x86_FP_RND_DOWN) in Print_x86_float_state_t()
9500 else if (fpu.fpu_fcw.rc == MachO::x86_FP_RND_UP) in Print_x86_float_state_t()
9502 else if (fpu.fpu_fcw.rc == MachO::x86_FP_CHOP) in Print_x86_float_state_t()
9590 static void Print_x86_exception_state_t(MachO::x86_exception_state64_t &exc64) { in Print_x86_exception_state_t()
9596 static void Print_arm_thread_state32_t(MachO::arm_thread_state32_t &cpu32) { in Print_arm_thread_state32_t()
9616 static void Print_arm_thread_state64_t(MachO::arm_thread_state64_t &cpu64) { in Print_arm_thread_state64_t()
9653 static void PrintThreadCommand(MachO::thread_command t, const char *Ptr, in PrintThreadCommand()
9655 if (t.cmd == MachO::LC_THREAD) in PrintThreadCommand()
9657 else if (t.cmd == MachO::LC_UNIXTHREAD) in PrintThreadCommand()
9662 if (t.cmdsize < sizeof(struct MachO::thread_command) + 2 * sizeof(uint32_t)) in PrintThreadCommand()
9667 const char *begin = Ptr + sizeof(struct MachO::thread_command); in PrintThreadCommand()
9670 if (cputype == MachO::CPU_TYPE_I386) { in PrintThreadCommand()
9690 if (flavor == MachO::x86_THREAD_STATE32) { in PrintThreadCommand()
9692 if (count == MachO::x86_THREAD_STATE32_COUNT) in PrintThreadCommand()
9697 MachO::x86_thread_state32_t cpu32; in PrintThreadCommand()
9699 if (left >= sizeof(MachO::x86_thread_state32_t)) { in PrintThreadCommand()
9700 memcpy(&cpu32, begin, sizeof(MachO::x86_thread_state32_t)); in PrintThreadCommand()
9701 begin += sizeof(MachO::x86_thread_state32_t); in PrintThreadCommand()
9703 memset(&cpu32, '\0', sizeof(MachO::x86_thread_state32_t)); in PrintThreadCommand()
9710 } else if (flavor == MachO::x86_THREAD_STATE) { in PrintThreadCommand()
9712 if (count == MachO::x86_THREAD_STATE_COUNT) in PrintThreadCommand()
9717 struct MachO::x86_thread_state_t ts; in PrintThreadCommand()
9719 if (left >= sizeof(MachO::x86_thread_state_t)) { in PrintThreadCommand()
9720 memcpy(&ts, begin, sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9721 begin += sizeof(MachO::x86_thread_state_t); in PrintThreadCommand()
9723 memset(&ts, '\0', sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9729 if (ts.tsh.flavor == MachO::x86_THREAD_STATE32) { in PrintThreadCommand()
9731 if (ts.tsh.count == MachO::x86_THREAD_STATE32_COUNT) in PrintThreadCommand()
9748 } else if (cputype == MachO::CPU_TYPE_X86_64) { in PrintThreadCommand()
9768 if (flavor == MachO::x86_THREAD_STATE64) { in PrintThreadCommand()
9770 if (count == MachO::x86_THREAD_STATE64_COUNT) in PrintThreadCommand()
9775 MachO::x86_thread_state64_t cpu64; in PrintThreadCommand()
9777 if (left >= sizeof(MachO::x86_thread_state64_t)) { in PrintThreadCommand()
9778 memcpy(&cpu64, begin, sizeof(MachO::x86_thread_state64_t)); in PrintThreadCommand()
9779 begin += sizeof(MachO::x86_thread_state64_t); in PrintThreadCommand()
9781 memset(&cpu64, '\0', sizeof(MachO::x86_thread_state64_t)); in PrintThreadCommand()
9788 } else if (flavor == MachO::x86_THREAD_STATE) { in PrintThreadCommand()
9790 if (count == MachO::x86_THREAD_STATE_COUNT) in PrintThreadCommand()
9795 struct MachO::x86_thread_state_t ts; in PrintThreadCommand()
9797 if (left >= sizeof(MachO::x86_thread_state_t)) { in PrintThreadCommand()
9798 memcpy(&ts, begin, sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9799 begin += sizeof(MachO::x86_thread_state_t); in PrintThreadCommand()
9801 memset(&ts, '\0', sizeof(MachO::x86_thread_state_t)); in PrintThreadCommand()
9807 if (ts.tsh.flavor == MachO::x86_THREAD_STATE64) { in PrintThreadCommand()
9809 if (ts.tsh.count == MachO::x86_THREAD_STATE64_COUNT) in PrintThreadCommand()
9819 } else if (flavor == MachO::x86_FLOAT_STATE) { in PrintThreadCommand()
9821 if (count == MachO::x86_FLOAT_STATE_COUNT) in PrintThreadCommand()
9825 struct MachO::x86_float_state_t fs; in PrintThreadCommand()
9827 if (left >= sizeof(MachO::x86_float_state_t)) { in PrintThreadCommand()
9828 memcpy(&fs, begin, sizeof(MachO::x86_float_state_t)); in PrintThreadCommand()
9829 begin += sizeof(MachO::x86_float_state_t); in PrintThreadCommand()
9831 memset(&fs, '\0', sizeof(MachO::x86_float_state_t)); in PrintThreadCommand()
9837 if (fs.fsh.flavor == MachO::x86_FLOAT_STATE64) { in PrintThreadCommand()
9839 if (fs.fsh.count == MachO::x86_FLOAT_STATE64_COUNT) in PrintThreadCommand()
9849 } else if (flavor == MachO::x86_EXCEPTION_STATE) { in PrintThreadCommand()
9851 if (count == MachO::x86_EXCEPTION_STATE_COUNT) in PrintThreadCommand()
9856 struct MachO::x86_exception_state_t es; in PrintThreadCommand()
9858 if (left >= sizeof(MachO::x86_exception_state_t)) { in PrintThreadCommand()
9859 memcpy(&es, begin, sizeof(MachO::x86_exception_state_t)); in PrintThreadCommand()
9860 begin += sizeof(MachO::x86_exception_state_t); in PrintThreadCommand()
9862 memset(&es, '\0', sizeof(MachO::x86_exception_state_t)); in PrintThreadCommand()
9868 if (es.esh.flavor == MachO::x86_EXCEPTION_STATE64) { in PrintThreadCommand()
9870 if (es.esh.count == MachO::x86_EXCEPTION_STATE64_COUNT) in PrintThreadCommand()
9880 } else if (flavor == MachO::x86_EXCEPTION_STATE64) { in PrintThreadCommand()
9882 if (count == MachO::x86_EXCEPTION_STATE64_COUNT) in PrintThreadCommand()
9887 struct MachO::x86_exception_state64_t es64; in PrintThreadCommand()
9889 if (left >= sizeof(MachO::x86_exception_state64_t)) { in PrintThreadCommand()
9890 memcpy(&es64, begin, sizeof(MachO::x86_exception_state64_t)); in PrintThreadCommand()
9891 begin += sizeof(MachO::x86_exception_state64_t); in PrintThreadCommand()
9893 memset(&es64, '\0', sizeof(MachO::x86_exception_state64_t)); in PrintThreadCommand()
9907 } else if (cputype == MachO::CPU_TYPE_ARM) { in PrintThreadCommand()
9927 if (flavor == MachO::ARM_THREAD_STATE) { in PrintThreadCommand()
9929 if (count == MachO::ARM_THREAD_STATE_COUNT) in PrintThreadCommand()
9934 MachO::arm_thread_state32_t cpu32; in PrintThreadCommand()
9936 if (left >= sizeof(MachO::arm_thread_state32_t)) { in PrintThreadCommand()
9937 memcpy(&cpu32, begin, sizeof(MachO::arm_thread_state32_t)); in PrintThreadCommand()
9938 begin += sizeof(MachO::arm_thread_state32_t); in PrintThreadCommand()
9940 memset(&cpu32, '\0', sizeof(MachO::arm_thread_state32_t)); in PrintThreadCommand()
9954 } else if (cputype == MachO::CPU_TYPE_ARM64 || in PrintThreadCommand()
9955 cputype == MachO::CPU_TYPE_ARM64_32) { in PrintThreadCommand()
9975 if (flavor == MachO::ARM_THREAD_STATE64) { in PrintThreadCommand()
9977 if (count == MachO::ARM_THREAD_STATE64_COUNT) in PrintThreadCommand()
9982 MachO::arm_thread_state64_t cpu64; in PrintThreadCommand()
9984 if (left >= sizeof(MachO::arm_thread_state64_t)) { in PrintThreadCommand()
9985 memcpy(&cpu64, begin, sizeof(MachO::arm_thread_state64_t)); in PrintThreadCommand()
9986 begin += sizeof(MachO::arm_thread_state64_t); in PrintThreadCommand()
9988 memset(&cpu64, '\0', sizeof(MachO::arm_thread_state64_t)); in PrintThreadCommand()
10030 static void PrintDylibCommand(MachO::dylib_command dl, const char *Ptr) { in PrintDylibCommand()
10031 if (dl.cmd == MachO::LC_ID_DYLIB) in PrintDylibCommand()
10033 else if (dl.cmd == MachO::LC_LOAD_DYLIB) in PrintDylibCommand()
10035 else if (dl.cmd == MachO::LC_LOAD_WEAK_DYLIB) in PrintDylibCommand()
10037 else if (dl.cmd == MachO::LC_REEXPORT_DYLIB) in PrintDylibCommand()
10039 else if (dl.cmd == MachO::LC_LAZY_LOAD_DYLIB) in PrintDylibCommand()
10041 else if (dl.cmd == MachO::LC_LOAD_UPWARD_DYLIB) in PrintDylibCommand()
10046 if (dl.cmdsize < sizeof(struct MachO::dylib_command)) in PrintDylibCommand()
10075 static void PrintLinkEditDataCommand(MachO::linkedit_data_command ld, in PrintLinkEditDataCommand()
10077 if (ld.cmd == MachO::LC_CODE_SIGNATURE) in PrintLinkEditDataCommand()
10079 else if (ld.cmd == MachO::LC_SEGMENT_SPLIT_INFO) in PrintLinkEditDataCommand()
10081 else if (ld.cmd == MachO::LC_FUNCTION_STARTS) in PrintLinkEditDataCommand()
10083 else if (ld.cmd == MachO::LC_DATA_IN_CODE) in PrintLinkEditDataCommand()
10085 else if (ld.cmd == MachO::LC_DYLIB_CODE_SIGN_DRS) in PrintLinkEditDataCommand()
10087 else if (ld.cmd == MachO::LC_LINKER_OPTIMIZATION_HINT) in PrintLinkEditDataCommand()
10089 else if (ld.cmd == MachO::LC_DYLD_EXPORTS_TRIE) in PrintLinkEditDataCommand()
10091 else if (ld.cmd == MachO::LC_DYLD_CHAINED_FIXUPS) in PrintLinkEditDataCommand()
10096 if (ld.cmdsize != sizeof(struct MachO::linkedit_data_command)) in PrintLinkEditDataCommand()
10120 if (Command.C.cmd == MachO::LC_SEGMENT) { in PrintLoadCommands()
10121 MachO::segment_command SLC = Obj->getSegmentLoadCommand(Command); in PrintLoadCommands()
10128 MachO::section S = Obj->getSection(Command, j); in PrintLoadCommands()
10133 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in PrintLoadCommands()
10134 MachO::segment_command_64 SLC_64 = Obj->getSegment64LoadCommand(Command); in PrintLoadCommands()
10141 MachO::section_64 S_64 = Obj->getSection64(Command, j); in PrintLoadCommands()
10147 } else if (Command.C.cmd == MachO::LC_SYMTAB) { in PrintLoadCommands()
10148 MachO::symtab_command Symtab = Obj->getSymtabLoadCommand(); in PrintLoadCommands()
10150 } else if (Command.C.cmd == MachO::LC_DYSYMTAB) { in PrintLoadCommands()
10151 MachO::dysymtab_command Dysymtab = Obj->getDysymtabLoadCommand(); in PrintLoadCommands()
10152 MachO::symtab_command Symtab = Obj->getSymtabLoadCommand(); in PrintLoadCommands()
10155 } else if (Command.C.cmd == MachO::LC_DYLD_INFO || in PrintLoadCommands()
10156 Command.C.cmd == MachO::LC_DYLD_INFO_ONLY) { in PrintLoadCommands()
10157 MachO::dyld_info_command DyldInfo = Obj->getDyldInfoLoadCommand(Command); in PrintLoadCommands()
10159 } else if (Command.C.cmd == MachO::LC_LOAD_DYLINKER || in PrintLoadCommands()
10160 Command.C.cmd == MachO::LC_ID_DYLINKER || in PrintLoadCommands()
10161 Command.C.cmd == MachO::LC_DYLD_ENVIRONMENT) { in PrintLoadCommands()
10162 MachO::dylinker_command Dyld = Obj->getDylinkerCommand(Command); in PrintLoadCommands()
10164 } else if (Command.C.cmd == MachO::LC_UUID) { in PrintLoadCommands()
10165 MachO::uuid_command Uuid = Obj->getUuidCommand(Command); in PrintLoadCommands()
10167 } else if (Command.C.cmd == MachO::LC_RPATH) { in PrintLoadCommands()
10168 MachO::rpath_command Rpath = Obj->getRpathCommand(Command); in PrintLoadCommands()
10170 } else if (Command.C.cmd == MachO::LC_VERSION_MIN_MACOSX || in PrintLoadCommands()
10171 Command.C.cmd == MachO::LC_VERSION_MIN_IPHONEOS || in PrintLoadCommands()
10172 Command.C.cmd == MachO::LC_VERSION_MIN_TVOS || in PrintLoadCommands()
10173 Command.C.cmd == MachO::LC_VERSION_MIN_WATCHOS) { in PrintLoadCommands()
10174 MachO::version_min_command Vd = Obj->getVersionMinLoadCommand(Command); in PrintLoadCommands()
10176 } else if (Command.C.cmd == MachO::LC_NOTE) { in PrintLoadCommands()
10177 MachO::note_command Nt = Obj->getNoteLoadCommand(Command); in PrintLoadCommands()
10179 } else if (Command.C.cmd == MachO::LC_BUILD_VERSION) { in PrintLoadCommands()
10180 MachO::build_version_command Bv = in PrintLoadCommands()
10183 } else if (Command.C.cmd == MachO::LC_SOURCE_VERSION) { in PrintLoadCommands()
10184 MachO::source_version_command Sd = Obj->getSourceVersionCommand(Command); in PrintLoadCommands()
10186 } else if (Command.C.cmd == MachO::LC_MAIN) { in PrintLoadCommands()
10187 MachO::entry_point_command Ep = Obj->getEntryPointCommand(Command); in PrintLoadCommands()
10189 } else if (Command.C.cmd == MachO::LC_ENCRYPTION_INFO) { in PrintLoadCommands()
10190 MachO::encryption_info_command Ei = in PrintLoadCommands()
10193 } else if (Command.C.cmd == MachO::LC_ENCRYPTION_INFO_64) { in PrintLoadCommands()
10194 MachO::encryption_info_command_64 Ei = in PrintLoadCommands()
10197 } else if (Command.C.cmd == MachO::LC_LINKER_OPTION) { in PrintLoadCommands()
10198 MachO::linker_option_command Lo = in PrintLoadCommands()
10201 } else if (Command.C.cmd == MachO::LC_SUB_FRAMEWORK) { in PrintLoadCommands()
10202 MachO::sub_framework_command Sf = Obj->getSubFrameworkCommand(Command); in PrintLoadCommands()
10204 } else if (Command.C.cmd == MachO::LC_SUB_UMBRELLA) { in PrintLoadCommands()
10205 MachO::sub_umbrella_command Sf = Obj->getSubUmbrellaCommand(Command); in PrintLoadCommands()
10207 } else if (Command.C.cmd == MachO::LC_SUB_LIBRARY) { in PrintLoadCommands()
10208 MachO::sub_library_command Sl = Obj->getSubLibraryCommand(Command); in PrintLoadCommands()
10210 } else if (Command.C.cmd == MachO::LC_SUB_CLIENT) { in PrintLoadCommands()
10211 MachO::sub_client_command Sc = Obj->getSubClientCommand(Command); in PrintLoadCommands()
10213 } else if (Command.C.cmd == MachO::LC_ROUTINES) { in PrintLoadCommands()
10214 MachO::routines_command Rc = Obj->getRoutinesCommand(Command); in PrintLoadCommands()
10216 } else if (Command.C.cmd == MachO::LC_ROUTINES_64) { in PrintLoadCommands()
10217 MachO::routines_command_64 Rc = Obj->getRoutinesCommand64(Command); in PrintLoadCommands()
10219 } else if (Command.C.cmd == MachO::LC_THREAD || in PrintLoadCommands()
10220 Command.C.cmd == MachO::LC_UNIXTHREAD) { in PrintLoadCommands()
10221 MachO::thread_command Tc = Obj->getThreadCommand(Command); in PrintLoadCommands()
10223 } else if (Command.C.cmd == MachO::LC_LOAD_DYLIB || in PrintLoadCommands()
10224 Command.C.cmd == MachO::LC_ID_DYLIB || in PrintLoadCommands()
10225 Command.C.cmd == MachO::LC_LOAD_WEAK_DYLIB || in PrintLoadCommands()
10226 Command.C.cmd == MachO::LC_REEXPORT_DYLIB || in PrintLoadCommands()
10227 Command.C.cmd == MachO::LC_LAZY_LOAD_DYLIB || in PrintLoadCommands()
10228 Command.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB) { in PrintLoadCommands()
10229 MachO::dylib_command Dl = Obj->getDylibIDLoadCommand(Command); in PrintLoadCommands()
10231 } else if (Command.C.cmd == MachO::LC_CODE_SIGNATURE || in PrintLoadCommands()
10232 Command.C.cmd == MachO::LC_SEGMENT_SPLIT_INFO || in PrintLoadCommands()
10233 Command.C.cmd == MachO::LC_FUNCTION_STARTS || in PrintLoadCommands()
10234 Command.C.cmd == MachO::LC_DATA_IN_CODE || in PrintLoadCommands()
10235 Command.C.cmd == MachO::LC_DYLIB_CODE_SIGN_DRS || in PrintLoadCommands()
10236 Command.C.cmd == MachO::LC_LINKER_OPTIMIZATION_HINT || in PrintLoadCommands()
10237 Command.C.cmd == MachO::LC_DYLD_EXPORTS_TRIE || in PrintLoadCommands()
10238 Command.C.cmd == MachO::LC_DYLD_CHAINED_FIXUPS) { in PrintLoadCommands()
10239 MachO::linkedit_data_command Ld = in PrintLoadCommands()
10254 MachO::mach_header_64 H_64; in PrintMachHeader()
10259 MachO::mach_header H; in PrintMachHeader()
10276 MachO::mach_header_64 H_64; in printMachOLoadCommands()
10281 MachO::mach_header H; in printMachOLoadCommands()
10296 if (Command.C.cmd == MachO::LC_SEGMENT) { in printMachOExportsTrie()
10297 MachO::segment_command Seg = Obj->getSegmentLoadCommand(Command); in printMachOExportsTrie()
10302 } else if (Command.C.cmd == MachO::LC_SEGMENT_64) { in printMachOExportsTrie()
10303 MachO::segment_command_64 Seg = Obj->getSegment64LoadCommand(Command); in printMachOExportsTrie()
10313 bool ReExport = (Flags & MachO::EXPORT_SYMBOL_FLAGS_REEXPORT); in printMachOExportsTrie()
10314 bool WeakDef = (Flags & MachO::EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION); in printMachOExportsTrie()
10315 bool ThreadLocal = ((Flags & MachO::EXPORT_SYMBOL_FLAGS_KIND_MASK) == in printMachOExportsTrie()
10316 MachO::EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL); in printMachOExportsTrie()
10317 bool Abs = ((Flags & MachO::EXPORT_SYMBOL_FLAGS_KIND_MASK) == in printMachOExportsTrie()
10318 MachO::EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE); in printMachOExportsTrie()
10319 bool Resolver = (Flags & MachO::EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER); in printMachOExportsTrie()
10378 case MachO::BIND_SPECIAL_DYLIB_SELF: in ordinalName()
10380 case MachO::BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE: in ordinalName()
10382 case MachO::BIND_SPECIAL_DYLIB_FLAT_LOOKUP: in ordinalName()
10413 if (Entry.flags() & MachO::BIND_SYMBOL_FLAGS_WEAK_IMPORT) in printMachOBindTable()
10462 if (Entry.flags() & MachO::BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION) { in printMachOWeakBindTable()
10508 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printLazyBindTable() local
10509 printMachOLazyBindTable(MachO); in printLazyBindTable()
10518 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printWeakBindTable() local
10519 printMachOWeakBindTable(MachO); in printWeakBindTable()
10528 if (const MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printExportsTrie() local
10529 printMachOExportsTrie(MachO); in printExportsTrie()
10538 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printRebaseTable() local
10539 printMachORebaseTable(MachO); in printRebaseTable()
10548 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o)) in printBindTable() local
10549 printMachOBindTable(MachO); in printBindTable()