Lines Matching refs:MachO
277 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj)) in isSymbolList64Bit() local
278 return MachO->is64Bit(); in isSymbolList64Bit()
296 MachO::mach_header H; in darwinPrintSymbol()
297 MachO::mach_header_64 H_64; in darwinPrintSymbol()
298 uint32_t Filetype = MachO::MH_OBJECT; in darwinPrintSymbol()
305 MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj); in darwinPrintSymbol() local
309 NType |= MachO::N_EXT; in darwinPrintSymbol()
311 NType |= MachO::N_PEXT; in darwinPrintSymbol()
313 NType |= MachO::N_EXT | MachO::N_UNDF; in darwinPrintSymbol()
318 NType |= MachO::N_SECT; in darwinPrintSymbol()
327 NDesc |= MachO::N_WEAK_DEF; in darwinPrintSymbol()
330 if (MachO->is64Bit()) { in darwinPrintSymbol()
331 H_64 = MachO->MachOObjectFile::getHeader64(); in darwinPrintSymbol()
334 MachO::nlist_64 STE_64 = MachO->getSymbol64TableEntry(SymDRI); in darwinPrintSymbol()
341 H = MachO->MachOObjectFile::getHeader(); in darwinPrintSymbol()
344 MachO::nlist STE = MachO->getSymbolTableEntry(SymDRI); in darwinPrintSymbol()
371 if ((NType & MachO::N_TYPE) == MachO::N_INDR) in darwinPrintSymbol()
373 if (Obj.isIR() && (NType & MachO::N_TYPE) == MachO::N_TYPE) in darwinPrintSymbol()
378 switch (NType & MachO::N_TYPE) { in darwinPrintSymbol()
379 case MachO::N_UNDF: in darwinPrintSymbol()
382 if (MachO::GET_COMM_ALIGN(NDesc) != 0) in darwinPrintSymbol()
383 outs() << "(alignment 2^" << (int)MachO::GET_COMM_ALIGN(NDesc) << ") "; in darwinPrintSymbol()
385 if ((NType & MachO::N_TYPE) == MachO::N_PBUD) in darwinPrintSymbol()
389 if ((NDesc & MachO::REFERENCE_TYPE) == in darwinPrintSymbol()
390 MachO::REFERENCE_FLAG_UNDEFINED_LAZY) in darwinPrintSymbol()
392 else if ((NDesc & MachO::REFERENCE_TYPE) == in darwinPrintSymbol()
393 MachO::REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY) in darwinPrintSymbol()
395 else if ((NDesc & MachO::REFERENCE_TYPE) == in darwinPrintSymbol()
396 MachO::REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY) in darwinPrintSymbol()
402 case MachO::N_ABS: in darwinPrintSymbol()
405 case MachO::N_INDR: in darwinPrintSymbol()
408 case MachO::N_SECT: { in darwinPrintSymbol()
423 MachO->getSymbolSection(I->Sym.getRawDataRefImpl()); in darwinPrintSymbol()
432 MachO->getSectionName(Ref, SectionName); in darwinPrintSymbol()
433 StringRef SegmentName = MachO->getSectionFinalSegmentName(Ref); in darwinPrintSymbol()
442 if (NType & MachO::N_EXT) { in darwinPrintSymbol()
443 if (NDesc & MachO::REFERENCED_DYNAMICALLY) in darwinPrintSymbol()
445 if (NType & MachO::N_PEXT) { in darwinPrintSymbol()
446 if ((NDesc & MachO::N_WEAK_DEF) == MachO::N_WEAK_DEF) in darwinPrintSymbol()
451 if ((NDesc & MachO::N_WEAK_REF) == MachO::N_WEAK_REF || in darwinPrintSymbol()
452 (NDesc & MachO::N_WEAK_DEF) == MachO::N_WEAK_DEF) { in darwinPrintSymbol()
453 if ((NDesc & (MachO::N_WEAK_REF | MachO::N_WEAK_DEF)) == in darwinPrintSymbol()
454 (MachO::N_WEAK_REF | MachO::N_WEAK_DEF)) in darwinPrintSymbol()
462 if (NType & MachO::N_PEXT) in darwinPrintSymbol()
468 if (Filetype == MachO::MH_OBJECT && in darwinPrintSymbol()
469 (NDesc & MachO::N_NO_DEAD_STRIP) == MachO::N_NO_DEAD_STRIP) in darwinPrintSymbol()
472 if (Filetype == MachO::MH_OBJECT && in darwinPrintSymbol()
473 ((NType & MachO::N_TYPE) != MachO::N_UNDF) && in darwinPrintSymbol()
474 (NDesc & MachO::N_SYMBOL_RESOLVER) == MachO::N_SYMBOL_RESOLVER) in darwinPrintSymbol()
477 if (Filetype == MachO::MH_OBJECT && in darwinPrintSymbol()
478 ((NType & MachO::N_TYPE) != MachO::N_UNDF) && in darwinPrintSymbol()
479 (NDesc & MachO::N_ALT_ENTRY) == MachO::N_ALT_ENTRY) in darwinPrintSymbol()
482 if ((NDesc & MachO::N_ARM_THUMB_DEF) == MachO::N_ARM_THUMB_DEF) in darwinPrintSymbol()
485 if ((NType & MachO::N_TYPE) == MachO::N_INDR) { in darwinPrintSymbol()
488 if (!MachO || in darwinPrintSymbol()
489 MachO->getIndirectName(I->Sym.getRawDataRefImpl(), IndirectName)) in darwinPrintSymbol()
496 if ((Flags & MachO::MH_TWOLEVEL) == MachO::MH_TWOLEVEL && in darwinPrintSymbol()
497 (((NType & MachO::N_TYPE) == MachO::N_UNDF && NValue == 0) || in darwinPrintSymbol()
498 (NType & MachO::N_TYPE) == MachO::N_PBUD)) { in darwinPrintSymbol()
499 uint32_t LibraryOrdinal = MachO::GET_LIBRARY_ORDINAL(NDesc); in darwinPrintSymbol()
501 if (LibraryOrdinal == MachO::EXECUTABLE_ORDINAL) in darwinPrintSymbol()
503 else if (LibraryOrdinal == MachO::DYNAMIC_LOOKUP_ORDINAL) in darwinPrintSymbol()
507 if (!MachO || in darwinPrintSymbol()
508 MachO->getLibraryShortNameByIndex(LibraryOrdinal - 1, LibraryName)) in darwinPrintSymbol()
525 {MachO::N_GSYM, "GSYM"},
526 {MachO::N_FNAME, "FNAME"},
527 {MachO::N_FUN, "FUN"},
528 {MachO::N_STSYM, "STSYM"},
529 {MachO::N_LCSYM, "LCSYM"},
530 {MachO::N_BNSYM, "BNSYM"},
531 {MachO::N_PC, "PC"},
532 {MachO::N_AST, "AST"},
533 {MachO::N_OPT, "OPT"},
534 {MachO::N_RSYM, "RSYM"},
535 {MachO::N_SLINE, "SLINE"},
536 {MachO::N_ENSYM, "ENSYM"},
537 {MachO::N_SSYM, "SSYM"},
538 {MachO::N_SO, "SO"},
539 {MachO::N_OSO, "OSO"},
540 {MachO::N_LSYM, "LSYM"},
541 {MachO::N_BINCL, "BINCL"},
542 {MachO::N_SOL, "SOL"},
543 {MachO::N_PARAMS, "PARAM"},
544 {MachO::N_VERSION, "VERS"},
545 {MachO::N_OLEVEL, "OLEV"},
546 {MachO::N_PSYM, "PSYM"},
547 {MachO::N_EINCL, "EINCL"},
548 {MachO::N_ENTRY, "ENTRY"},
549 {MachO::N_LBRAC, "LBRAC"},
550 {MachO::N_EXCL, "EXCL"},
551 {MachO::N_RBRAC, "RBRAC"},
552 {MachO::N_BCOMM, "BCOMM"},
553 {MachO::N_ECOMM, "ECOMM"},
554 {MachO::N_ECOML, "ECOML"},
555 {MachO::N_LENG, "LENG"},
568 static void darwinPrintStab(MachOObjectFile *MachO, SymbolListT::iterator I) { in darwinPrintStab() argument
569 MachO::nlist_64 STE_64; in darwinPrintStab()
570 MachO::nlist STE; in darwinPrintStab()
575 if (MachO->is64Bit()) { in darwinPrintStab()
576 STE_64 = MachO->getSymbol64TableEntry(SymDRI); in darwinPrintStab()
581 STE = MachO->getSymbolTableEntry(SymDRI); in darwinPrintStab()
709 MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj); in sortAndPrintSymbolList() local
710 if ((OutputFormat == darwin || FormatMachOasHex) && (MachO || Obj.isIR())) { in sortAndPrintSymbolList()
715 if (MachO) in sortAndPrintSymbolList()
719 } else if (OutputFormat == bsd || (OutputFormat == darwin && !MachO)) { in sortAndPrintSymbolList()
727 if (I->TypeChar == '-' && MachO) in sortAndPrintSymbolList()
728 darwinPrintStab(MachO, I); in sortAndPrintSymbolList()
847 if (NType & MachO::N_STAB) in getSymbolNMTypeChar()
850 switch (NType & MachO::N_TYPE) { in getSymbolNMTypeChar()
851 case MachO::N_ABS: in getSymbolNMTypeChar()
853 case MachO::N_INDR: in getSymbolNMTypeChar()
855 case MachO::N_SECT: { in getSymbolNMTypeChar()
920 else if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj)) in getNMTypeChar() local
921 Ret = getSymbolNMTypeChar(*MachO, I); in getNMTypeChar()
959 MachO::nlist_64 STE = Obj.getSymbol64TableEntry(Symb); in getNsectInMachO()
960 return (STE.n_type & MachO::N_TYPE) == MachO::N_SECT ? STE.n_sect : 0; in getNsectInMachO()
962 MachO::nlist STE = Obj.getSymbolTableEntry(Symb); in getNsectInMachO()
963 return (STE.n_type & MachO::N_TYPE) == MachO::N_SECT ? STE.n_sect : 0; in getNsectInMachO()
986 MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj); in dumpSymbolNamesFromObject() local
987 if (SegSect.size() != 0 && MachO) { in dumpSymbolNamesFromObject()
988 Nsect = getNsectForSegSect(MachO); in dumpSymbolNamesFromObject()
1007 if (Nsect && Nsect != getNsectInMachO(*MachO, Sym)) in dumpSymbolNamesFromObject()
1027 if (EC && MachO) in dumpSymbolNamesFromObject()
1053 MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(O); in checkMachOAndArchFlags() local
1055 if (!MachO || ArchAll || ArchFlags.size() == 0) in checkMachOAndArchFlags()
1058 MachO::mach_header H; in checkMachOAndArchFlags()
1059 MachO::mach_header_64 H_64; in checkMachOAndArchFlags()
1061 if (MachO->is64Bit()) { in checkMachOAndArchFlags()
1062 H_64 = MachO->MachOObjectFile::getHeader64(); in checkMachOAndArchFlags()
1065 H = MachO->MachOObjectFile::getHeader(); in checkMachOAndArchFlags()