Lines Matching refs:MachO
251 if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj)) in isSymbolList64Bit() local
252 return MachO->is64Bit(); in isSymbolList64Bit()
273 static void darwinPrintSymbol(MachOObjectFile *MachO, SymbolListT::iterator I, in darwinPrintSymbol() argument
275 MachO::mach_header H; in darwinPrintSymbol()
276 MachO::mach_header_64 H_64; in darwinPrintSymbol()
278 MachO::nlist_64 STE_64; in darwinPrintSymbol()
279 MachO::nlist STE; in darwinPrintSymbol()
285 if (MachO->is64Bit()) { in darwinPrintSymbol()
286 H_64 = MachO->MachOObjectFile::getHeader64(); in darwinPrintSymbol()
289 STE_64 = MachO->getSymbol64TableEntry(I->Symb); in darwinPrintSymbol()
296 H = MachO->MachOObjectFile::getHeader(); in darwinPrintSymbol()
299 STE = MachO->getSymbolTableEntry(I->Symb); in darwinPrintSymbol()
311 if (MachO->is64Bit()) in darwinPrintSymbol()
330 if ((NType & MachO::N_TYPE) == MachO::N_INDR) in darwinPrintSymbol()
335 switch (NType & MachO::N_TYPE) { in darwinPrintSymbol()
336 case MachO::N_UNDF: in darwinPrintSymbol()
339 if (MachO::GET_COMM_ALIGN(NDesc) != 0) in darwinPrintSymbol()
340 outs() << "(alignment 2^" << (int)MachO::GET_COMM_ALIGN(NDesc) << ") "; in darwinPrintSymbol()
342 if ((NType & MachO::N_TYPE) == MachO::N_PBUD) in darwinPrintSymbol()
346 if ((NDesc & MachO::REFERENCE_TYPE) == in darwinPrintSymbol()
347 MachO::REFERENCE_FLAG_UNDEFINED_LAZY) in darwinPrintSymbol()
349 else if ((NDesc & MachO::REFERENCE_TYPE) == in darwinPrintSymbol()
350 MachO::REFERENCE_FLAG_UNDEFINED_LAZY) in darwinPrintSymbol()
352 else if ((NDesc & MachO::REFERENCE_TYPE) == in darwinPrintSymbol()
353 MachO::REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY) in darwinPrintSymbol()
359 case MachO::N_ABS: in darwinPrintSymbol()
362 case MachO::N_INDR: in darwinPrintSymbol()
365 case MachO::N_SECT: { in darwinPrintSymbol()
366 section_iterator Sec = MachO->section_end(); in darwinPrintSymbol()
367 MachO->getSymbolSection(I->Symb, Sec); in darwinPrintSymbol()
370 MachO->getSectionName(Ref, SectionName); in darwinPrintSymbol()
371 StringRef SegmentName = MachO->getSectionFinalSegmentName(Ref); in darwinPrintSymbol()
380 if (NType & MachO::N_EXT) { in darwinPrintSymbol()
381 if (NDesc & MachO::REFERENCED_DYNAMICALLY) in darwinPrintSymbol()
383 if (NType & MachO::N_PEXT) { in darwinPrintSymbol()
384 if ((NDesc & MachO::N_WEAK_DEF) == MachO::N_WEAK_DEF) in darwinPrintSymbol()
389 if ((NDesc & MachO::N_WEAK_REF) == MachO::N_WEAK_REF || in darwinPrintSymbol()
390 (NDesc & MachO::N_WEAK_DEF) == MachO::N_WEAK_DEF) { in darwinPrintSymbol()
391 if ((NDesc & (MachO::N_WEAK_REF | MachO::N_WEAK_DEF)) == in darwinPrintSymbol()
392 (MachO::N_WEAK_REF | MachO::N_WEAK_DEF)) in darwinPrintSymbol()
400 if (NType & MachO::N_PEXT) in darwinPrintSymbol()
406 if (Filetype == MachO::MH_OBJECT && in darwinPrintSymbol()
407 (NDesc & MachO::N_NO_DEAD_STRIP) == MachO::N_NO_DEAD_STRIP) in darwinPrintSymbol()
410 if (Filetype == MachO::MH_OBJECT && in darwinPrintSymbol()
411 ((NType & MachO::N_TYPE) != MachO::N_UNDF) && in darwinPrintSymbol()
412 (NDesc & MachO::N_SYMBOL_RESOLVER) == MachO::N_SYMBOL_RESOLVER) in darwinPrintSymbol()
415 if (Filetype == MachO::MH_OBJECT && in darwinPrintSymbol()
416 ((NType & MachO::N_TYPE) != MachO::N_UNDF) && in darwinPrintSymbol()
417 (NDesc & MachO::N_ALT_ENTRY) == MachO::N_ALT_ENTRY) in darwinPrintSymbol()
420 if ((NDesc & MachO::N_ARM_THUMB_DEF) == MachO::N_ARM_THUMB_DEF) in darwinPrintSymbol()
423 if ((NType & MachO::N_TYPE) == MachO::N_INDR) { in darwinPrintSymbol()
426 if (MachO->getIndirectName(I->Symb, IndirectName)) in darwinPrintSymbol()
433 if ((Flags & MachO::MH_TWOLEVEL) == MachO::MH_TWOLEVEL && in darwinPrintSymbol()
434 (((NType & MachO::N_TYPE) == MachO::N_UNDF && NValue == 0) || in darwinPrintSymbol()
435 (NType & MachO::N_TYPE) == MachO::N_PBUD)) { in darwinPrintSymbol()
436 uint32_t LibraryOrdinal = MachO::GET_LIBRARY_ORDINAL(NDesc); in darwinPrintSymbol()
438 if (LibraryOrdinal == MachO::EXECUTABLE_ORDINAL) in darwinPrintSymbol()
440 else if (LibraryOrdinal == MachO::DYNAMIC_LOOKUP_ORDINAL) in darwinPrintSymbol()
444 if (MachO->getLibraryShortNameByIndex(LibraryOrdinal - 1, LibraryName)) in darwinPrintSymbol()
461 {MachO::N_GSYM, "GSYM"},
462 {MachO::N_FNAME, "FNAME"},
463 {MachO::N_FUN, "FUN"},
464 {MachO::N_STSYM, "STSYM"},
465 {MachO::N_LCSYM, "LCSYM"},
466 {MachO::N_BNSYM, "BNSYM"},
467 {MachO::N_PC, "PC"},
468 {MachO::N_AST, "AST"},
469 {MachO::N_OPT, "OPT"},
470 {MachO::N_RSYM, "RSYM"},
471 {MachO::N_SLINE, "SLINE"},
472 {MachO::N_ENSYM, "ENSYM"},
473 {MachO::N_SSYM, "SSYM"},
474 {MachO::N_SO, "SO"},
475 {MachO::N_OSO, "OSO"},
476 {MachO::N_LSYM, "LSYM"},
477 {MachO::N_BINCL, "BINCL"},
478 {MachO::N_SOL, "SOL"},
479 {MachO::N_PARAMS, "PARAM"},
480 {MachO::N_VERSION, "VERS"},
481 {MachO::N_OLEVEL, "OLEV"},
482 {MachO::N_PSYM, "PSYM"},
483 {MachO::N_EINCL, "EINCL"},
484 {MachO::N_ENTRY, "ENTRY"},
485 {MachO::N_LBRAC, "LBRAC"},
486 {MachO::N_EXCL, "EXCL"},
487 {MachO::N_RBRAC, "RBRAC"},
488 {MachO::N_BCOMM, "BCOMM"},
489 {MachO::N_ECOMM, "ECOMM"},
490 {MachO::N_ECOML, "ECOML"},
491 {MachO::N_LENG, "LENG"},
503 static void darwinPrintStab(MachOObjectFile *MachO, SymbolListT::iterator I) { in darwinPrintStab() argument
504 MachO::nlist_64 STE_64; in darwinPrintStab()
505 MachO::nlist STE; in darwinPrintStab()
509 if (MachO->is64Bit()) { in darwinPrintStab()
510 STE_64 = MachO->getSymbol64TableEntry(I->Symb); in darwinPrintStab()
515 STE = MachO->getSymbolTableEntry(I->Symb); in darwinPrintStab()
605 MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj); in sortAndPrintSymbolList() local
606 if ((OutputFormat == darwin || FormatMachOasHex) && MachO) { in sortAndPrintSymbolList()
607 darwinPrintSymbol(MachO, I, SymbolAddrStr, printBlanks); in sortAndPrintSymbolList()
611 } else if (OutputFormat == bsd || (OutputFormat == darwin && !MachO)) { in sortAndPrintSymbolList()
620 if (I->TypeChar == '-' && MachO) in sortAndPrintSymbolList()
621 darwinPrintStab(MachO, I); in sortAndPrintSymbolList()
732 MachO::nlist_64 STE = Obj.getSymbol64TableEntry(Symb); in getNType()
735 MachO::nlist STE = Obj.getSymbolTableEntry(Symb); in getNType()
743 if (NType & MachO::N_STAB) in getSymbolNMTypeChar()
746 switch (NType & MachO::N_TYPE) { in getSymbolNMTypeChar()
747 case MachO::N_ABS: in getSymbolNMTypeChar()
749 case MachO::N_INDR: in getSymbolNMTypeChar()
751 case MachO::N_SECT: { in getSymbolNMTypeChar()
831 else if (MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj)) in getNMTypeChar() local
832 Ret = getSymbolNMTypeChar(*MachO, I); in getNMTypeChar()
877 MachO::nlist_64 STE = Obj.getSymbol64TableEntry(Symb); in getNsectInMachO()
878 if ((STE.n_type & MachO::N_TYPE) == MachO::N_SECT) in getNsectInMachO()
882 MachO::nlist STE = Obj.getSymbolTableEntry(Symb); in getNsectInMachO()
883 if ((STE.n_type & MachO::N_TYPE) == MachO::N_SECT) in getNsectInMachO()
909 MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(&Obj); in dumpSymbolNamesFromObject() local
910 if (SegSect.size() != 0 && MachO) { in dumpSymbolNamesFromObject()
911 Nsect = getNsectForSegSect(MachO); in dumpSymbolNamesFromObject()
930 if (Nsect && Nsect != getNsectInMachO(*MachO, I)) in dumpSymbolNamesFromObject()
968 MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(O); in checkMachOAndArchFlags() local
970 if (!MachO || ArchAll || ArchFlags.size() == 0) in checkMachOAndArchFlags()
973 MachO::mach_header H; in checkMachOAndArchFlags()
974 MachO::mach_header_64 H_64; in checkMachOAndArchFlags()
976 if (MachO->is64Bit()) { in checkMachOAndArchFlags()
977 H_64 = MachO->MachOObjectFile::getHeader64(); in checkMachOAndArchFlags()
980 H = MachO->MachOObjectFile::getHeader(); in checkMachOAndArchFlags()