Lines Matching refs:MachO

15 #include "llvm/Object/MachO.h"
53 void SwapStruct(MachO::any_relocation_info &H) {
59 void SwapStruct(MachO::load_command &L) {
71 void SwapStruct(MachO::section &S) {
84 void SwapStruct(MachO::section_64 &S) {
98 void SwapStruct(MachO::nlist &S) {
105 void SwapStruct(MachO::nlist_64 &S) {
112 void SwapStruct(MachO::mach_header &H) {
123 void SwapStruct(MachO::mach_header_64 &H) {
135 void SwapStruct(MachO::symtab_command &C) {
145 void SwapStruct(MachO::dysymtab_command &C) {
169 void SwapStruct(MachO::linkedit_data_command &C) {
177 void SwapStruct(MachO::segment_command &C) {
191 void SwapStruct(MachO::segment_command_64 &C) {
210 void SwapStruct(MachO::linker_options_command &C) {
217 void SwapStruct(MachO::data_in_code_entry &C) {
236 MachO::segment_command_64 S = O->getSegment64LoadCommand(L);
239 MachO::segment_command S = O->getSegmentLoadCommand(L);
249 unsigned SegmentLoadSize = Is64 ? sizeof(MachO::segment_command_64) :
250 sizeof(MachO::segment_command);
251 unsigned SectionSize = Is64 ? sizeof(MachO::section_64) :
252 sizeof(MachO::section);
297 const MachO::any_relocation_info &RE,
366 getPlainRelocationAddress(const MachO::any_relocation_info &RE) {
371 getScatteredRelocationAddress(const MachO::any_relocation_info &RE) {
376 const MachO::any_relocation_info &RE) {
384 const MachO::any_relocation_info &RE) {
389 const MachO::any_relocation_info &RE) {
396 getScatteredRelocationLength(const MachO::any_relocation_info &RE) {
401 const MachO::any_relocation_info &RE) {
408 getScatteredRelocationType(const MachO::any_relocation_info &RE) {
415 MachO::section_64 Sect = O->getSection64(Sec);
418 MachO::section Sect = O->getSection(Sec);
428 MachO::LoadCommandType SegmentLoadType = is64Bit() ?
429 MachO::LC_SEGMENT_64 : MachO::LC_SEGMENT;
433 if (Load.C.cmd == MachO::LC_SYMTAB) {
436 } else if (Load.C.cmd == MachO::LC_DYSYMTAB) {
439 } else if (Load.C.cmd == MachO::LC_DATA_IN_CODE) {
460 sizeof(MachO::nlist_64) :
461 sizeof(MachO::nlist);
479 MachO::nlist_64 Entry = getSymbol64TableEntry(Symb);
482 MachO::nlist Entry = getSymbolTableEntry(Symb);
498 MachO::section_64 Sec = getSection64(SecRel);
501 MachO::section Sec = getSection(SecRel);
517 Result = 1 << MachO::GET_COMM_ALIGN(Entry.n_desc);
578 if (n_type & MachO::N_STAB) {
583 switch (n_type & MachO::N_TYPE) {
584 case MachO::N_UNDF :
587 case MachO::N_SECT :
604 if ((MachOType & MachO::N_TYPE) == MachO::N_UNDF)
607 if (MachOType & MachO::N_STAB)
610 if (MachOType & MachO::N_EXT) {
612 if ((MachOType & MachO::N_TYPE) == MachO::N_UNDF) {
620 if (MachOFlags & (MachO::N_WEAK_REF | MachO::N_WEAK_DEF))
623 if ((MachOType & MachO::N_TYPE) == MachO::N_ABS)
668 MachO::section_64 Sect = getSection64(Sec);
671 MachO::section Sect = getSection(Sec);
680 MachO::section_64 Sect = getSection64(Sec);
683 MachO::section Sect = getSection(Sec);
696 MachO::section_64 Sect = getSection64(Sec);
700 MachO::section Sect = getSection(Sec);
713 MachO::section_64 Sect = getSection64(Sec);
716 MachO::section Sect = getSection(Sec);
727 Res = Flags & MachO::S_ATTR_PURE_INSTRUCTIONS;
761 unsigned SectionType = Flags & MachO::SECTION_TYPE;
762 Res = SectionType == MachO::S_ZEROFILL ||
763 SectionType == MachO::S_GB_ZEROFILL;
803 MachO::section_64 Sect = getSection64(Sec);
806 MachO::section Sect = getSection(Sec);
820 MachO::section_64 Sect = getSection64(Sec);
824 MachO::section Sect = getSection(Sec);
829 const MachO::any_relocation_info *P =
830 reinterpret_cast<const MachO::any_relocation_info *>(getPtr(this, Offset));
839 const MachO::any_relocation_info *P =
840 reinterpret_cast<const MachO::any_relocation_info *>(Rel.p);
853 MachO::any_relocation_info RE = getRelocation(Rel);
860 MachO::any_relocation_info RE = getRelocation(Rel);
866 MachO::symtab_command S = getSymtabLoadCommand();
868 sizeof(MachO::nlist_64) :
869 sizeof(MachO::nlist);
878 MachO::any_relocation_info RE = getRelocation(Rel);
979 MachO::any_relocation_info RE = getRelocation(Rel);
996 case MachO::X86_64_RELOC_GOT_LOAD:
997 case MachO::X86_64_RELOC_GOT: {
1003 case MachO::X86_64_RELOC_SUBTRACTOR: {
1006 MachO::any_relocation_info RENext = getRelocation(RelNext);
1012 if (RType != MachO::X86_64_RELOC_UNSIGNED)
1023 case MachO::X86_64_RELOC_TLV:
1028 case MachO::X86_64_RELOC_SIGNED_1:
1032 case MachO::X86_64_RELOC_SIGNED_2:
1036 case MachO::X86_64_RELOC_SIGNED_4:
1049 case MachO::GENERIC_RELOC_PAIR: // prints no info
1051 case MachO::GENERIC_RELOC_SECTDIFF: {
1054 MachO::any_relocation_info RENext = getRelocation(RelNext);
1060 if (RType != MachO::GENERIC_RELOC_PAIR)
1073 case MachO::GENERIC_RELOC_LOCAL_SECTDIFF: {
1076 MachO::any_relocation_info RENext = getRelocation(RelNext);
1081 if (RType != MachO::GENERIC_RELOC_PAIR)
1090 case MachO::GENERIC_RELOC_TLV: {
1101 case MachO::ARM_RELOC_HALF:
1102 case MachO::ARM_RELOC_HALF_SECTDIFF: {
1115 MachO::any_relocation_info RENext = getRelocation(RelNext);
1120 if (RType != MachO::ARM_RELOC_PAIR)
1131 if (Type == MachO::ARM_RELOC_HALF_SECTDIFF) {
1163 if (Type == MachO::GENERIC_RELOC_PAIR) Result = true;
1167 if (Type == MachO::X86_64_RELOC_UNSIGNED && Rel.d.a > 0) {
1172 if (PrevType == MachO::X86_64_RELOC_SUBTRACTOR)
1195 MachO::symtab_command Symtab = getSymtabLoadCommand();
1205 MachO::symtab_command Symtab = getSymtabLoadCommand();
1207 sizeof(MachO::nlist_64) :
1208 sizeof(MachO::nlist);
1254 case llvm::MachO::CPU_TYPE_I386:
1256 case llvm::MachO::CPU_TYPE_ARM:
1258 case llvm::MachO::CPU_TYPE_POWERPC:
1261 assert((CPUType & llvm::MachO::CPU_ARCH_ABI64) == 0 &&
1268 assert((CPUType & llvm::MachO::CPU_ARCH_ABI64)
1269 == llvm::MachO::CPU_ARCH_ABI64 &&
1273 case llvm::MachO::CPU_TYPE_X86_64:
1275 case llvm::MachO::CPU_TYPE_POWERPC64:
1284 case llvm::MachO::CPU_TYPE_I386:
1286 case llvm::MachO::CPU_TYPE_X86_64:
1288 case llvm::MachO::CPU_TYPE_ARM:
1290 case llvm::MachO::CPU_TYPE_POWERPC:
1292 case llvm::MachO::CPU_TYPE_POWERPC64:
1325 MachO::linkedit_data_command DicLC = getDataInCodeLoadCommand();
1335 MachO::linkedit_data_command DicLC = getDataInCodeLoadCommand();
1362 MachOObjectFile::isRelocationScattered(const MachO::any_relocation_info &RE)
1364 if (getCPUType(this) == MachO::CPU_TYPE_X86_64)
1366 return getPlainRelocationAddress(RE) & MachO::R_SCATTERED;
1370 const MachO::any_relocation_info &RE) const {
1377 const MachO::any_relocation_info &RE) const {
1384 const MachO::any_relocation_info &RE) const {
1389 const MachO::any_relocation_info &RE) const {
1394 const MachO::any_relocation_info &RE) const {
1401 const MachO::any_relocation_info &RE) const {
1408 const MachO::any_relocation_info &RE) const {
1416 const MachO::any_relocation_info &RE) const {
1424 const MachO::any_relocation_info &RE) const {
1437 unsigned HeaderSize = is64Bit() ? sizeof(MachO::mach_header_64) :
1438 sizeof(MachO::mach_header);
1440 Load.C = getStruct<MachO::load_command>(this, Load.Ptr);
1448 Next.C = getStruct<MachO::load_command>(this, Next.Ptr);
1452 MachO::section MachOObjectFile::getSection(DataRefImpl DRI) const {
1453 return getStruct<MachO::section>(this, Sections[DRI.d.a]);
1456 MachO::section_64 MachOObjectFile::getSection64(DataRefImpl DRI) const {
1457 return getStruct<MachO::section_64>(this, Sections[DRI.d.a]);
1460 MachO::section MachOObjectFile::getSection(const LoadCommandInfo &L,
1463 return getStruct<MachO::section>(this, Sec);
1466 MachO::section_64 MachOObjectFile::getSection64(const LoadCommandInfo &L,
1469 return getStruct<MachO::section_64>(this, Sec);
1472 MachO::nlist
1475 return getStruct<MachO::nlist>(this, P);
1478 MachO::nlist_64
1481 return getStruct<MachO::nlist_64>(this, P);
1484 MachO::linkedit_data_command
1486 return getStruct<MachO::linkedit_data_command>(this, L.Ptr);
1489 MachO::segment_command
1491 return getStruct<MachO::segment_command>(this, L.Ptr);
1494 MachO::segment_command_64
1496 return getStruct<MachO::segment_command_64>(this, L.Ptr);
1499 MachO::linker_options_command
1501 return getStruct<MachO::linker_options_command>(this, L.Ptr);
1504 MachO::any_relocation_info
1507 return getStruct<MachO::any_relocation_info>(this, P);
1510 MachO::data_in_code_entry
1513 return getStruct<MachO::data_in_code_entry>(this, P);
1516 MachO::mach_header MachOObjectFile::getHeader() const {
1517 return getStruct<MachO::mach_header>(this, getPtr(this, 0));
1520 MachO::mach_header_64 MachOObjectFile::getHeader64() const {
1521 return getStruct<MachO::mach_header_64>(this, getPtr(this, 0));
1525 const MachO::dysymtab_command &DLC,
1531 MachO::data_in_code_entry
1534 uint64_t Offset = DataOffset + Index * sizeof(MachO::data_in_code_entry);
1535 return getStruct<MachO::data_in_code_entry>(this, getPtr(this, Offset));
1538 MachO::symtab_command MachOObjectFile::getSymtabLoadCommand() const {
1539 return getStruct<MachO::symtab_command>(this, SymtabLoadCmd);
1542 MachO::dysymtab_command MachOObjectFile::getDysymtabLoadCommand() const {
1543 return getStruct<MachO::dysymtab_command>(this, DysymtabLoadCmd);
1546 MachO::linkedit_data_command
1549 return getStruct<MachO::linkedit_data_command>(this, DataInCodeLoadCmd);
1552 MachO::linkedit_data_command Cmd;
1553 Cmd.cmd = MachO::LC_DATA_IN_CODE;
1554 Cmd.cmdsize = sizeof(MachO::linkedit_data_command);
1561 MachO::symtab_command S = getSymtabLoadCommand();