Lines Matching +full:mach +full:- +full:o

1 //===- MachOObjectFile.cpp - Mach-O object file binding ---------*- C++ -*-===//
8 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
50 static T getStruct(const MachOObjectFile *O, const char *P) { in getStruct() argument
52 if (P < O->getData().begin() || P + sizeof(T) > O->getData().end()) in getStruct()
57 if (O->isLittleEndian() != sys::IsLittleEndianHost) in getStruct()
63 static Expected<T> getStructOrErr(const MachOObjectFile *O, const char *P) { in getStructOrErr() argument
65 if (P < O->getData().begin() || P + sizeof(T) > O->getData().end()) in getStructOrErr()
66 return malformedError("Structure read out-of-range"); in getStructOrErr()
70 if (O->isLittleEndian() != sys::IsLittleEndianHost) in getStructOrErr()
76 getSectionPtr(const MachOObjectFile *O, MachOObjectFile::LoadCommandInfo L, in getSectionPtr() argument
80 bool Is64 = O->is64Bit(); in getSectionPtr()
90 static const char *getPtr(const MachOObjectFile *O, size_t Offset) { in getPtr() argument
91 return O->getData().substr(Offset, 1).data(); in getPtr()
95 getSymbolTableEntryBase(const MachOObjectFile *O, DataRefImpl DRI) { in getSymbolTableEntryBase() argument
97 return getStruct<MachO::nlist_base>(O, P); in getSymbolTableEntryBase()
111 while (Val--) in advance()
115 static unsigned getCPUType(const MachOObjectFile *O) { in getCPUType() argument
116 return O->getHeader().cputype; in getCPUType()
129 static bool getPlainRelocationPCRel(const MachOObjectFile *O, in getPlainRelocationPCRel() argument
131 if (O->isLittleEndian()) in getPlainRelocationPCRel()
137 getScatteredRelocationPCRel(const MachOObjectFile *O, in getScatteredRelocationPCRel() argument
142 static unsigned getPlainRelocationLength(const MachOObjectFile *O, in getPlainRelocationLength() argument
144 if (O->isLittleEndian()) in getPlainRelocationLength()
154 static unsigned getPlainRelocationType(const MachOObjectFile *O, in getPlainRelocationType() argument
156 if (O->isLittleEndian()) in getPlainRelocationType()
161 static uint32_t getSectionFlags(const MachOObjectFile *O, in getSectionFlags() argument
163 if (O->is64Bit()) { in getSectionFlags()
164 MachO::section_64 Sect = O->getSection64(Sec); in getSectionFlags()
167 MachO::section Sect = O->getSection(Sec); in getSectionFlags()
175 if (CmdOrErr->cmdsize < 8) in getLoadCommandInfo()
185 unsigned HeaderSize = Obj->is64Bit() ? sizeof(MachO::mach_header_64) in getFirstLoadCommandInfo()
187 if (sizeof(MachOObjectFile::LoadCommandInfo) > Obj->getHeader().sizeofcmds) in getFirstLoadCommandInfo()
196 unsigned HeaderSize = Obj->is64Bit() ? sizeof(MachO::mach_header_64) in getNextLoadCommandInfo()
199 Obj->getData().data() + HeaderSize + Obj->getHeader().sizeofcmds) in getNextLoadCommandInfo()
208 if (sizeof(T) > Obj->getData().size()) { in parseHeader()
209 Err = malformedError("the mach header extends past the end of the " in parseHeader()
234 Obj->is64Bit() ? sizeof(MachO::section_64) : sizeof(MachO::section); in parseSegmentLoadCommand()
236 S.nsects * SectionSize > Load.C.cmdsize - SegmentLoadSize) in parseSegmentLoadCommand()
302 // We have a hack here to allow 64-bit Mach-O core files to have in MachOObjectFile()
337 Err = malformedError("Multiple data-in-code tables"); in MachOObjectFile()
379 if (I < LoadCommandCount - 1) { in MachOObjectFile()
529 if (Sec->isData() || Sec->isBSS()) in getSymbolType()
583 DRI.d.a = index - 1; in getSymbolSection()
594 return Entry.n_sect - 1; in getSymbolSectionID()
615 // In the case if a malformed Mach-O file where the section offset is past in getSectionSize()
638 if (FileSize - SectOffset < SectSize) in getSectionSize()
639 return FileSize - SectOffset; in getSectionSize()
658 Res = this->getData().substr(Offset, Size); in getSectionContents()
788 unsigned Arch = this->getArch(); in getRelocationTypeName()
955 Idx + Foo.size() + sizeof(".framework/")-1); in guessLibraryShortName()
977 Idx + Foo.size() + sizeof(".framework/")-1); in guessLibraryShortName()
994 Dot = Name.slice(a-2, a-1); in guessLibraryShortName()
996 a = a - 2; in guessLibraryShortName()
1015 Dot = Lib.slice(Lib.size()-2, Lib.size()-1); in guessLibraryShortName()
1017 Lib = Lib.slice(0, Lib.size()-2); in guessLibraryShortName()
1032 Dot = Lib.slice(Lib.size()-2, Lib.size()-1); in guessLibraryShortName()
1034 Lib = Lib.slice(0, Lib.size()-2); in guessLibraryShortName()
1040 // for an undefined symbol in a linked Mach-O binary that was linked with the
1041 // normal two-level namespace default (that is MH_TWOLEVEL in the header).
1042 // It is passed the index (0 - based) of the library as translated from
1043 // GET_LIBRARY_ORDINAL (1 - based).
1078 Sec.d.a = Rel->getRawDataRefImpl().d.a; in getRelocationRelocatedSection()
1126 uint64_t Index = (Symb.p - DRIstart.p) / SymbolTableEntrySize; in getSymbolIndex()
1150 return "Mach-O 32-bit i386"; in getFileFormatName()
1152 return "Mach-O arm"; in getFileFormatName()
1154 return "Mach-O 32-bit ppc"; in getFileFormatName()
1156 return "Mach-O 32-bit unknown"; in getFileFormatName()
1162 return "Mach-O 64-bit x86-64"; in getFileFormatName()
1164 return "Mach-O arm64"; in getFileFormatName()
1166 return "Mach-O 64-bit ppc64"; in getFileFormatName()
1168 return "Mach-O 64-bit unknown"; in getFileFormatName()
1200 return Triple("i386-apple-darwin"); in getArchTriple()
1207 return Triple("x86_64-apple-darwin"); in getArchTriple()
1209 return Triple("x86_64h-apple-darwin"); in getArchTriple()
1216 return Triple("armv4t-apple-darwin"); in getArchTriple()
1218 return Triple("armv5e-apple-darwin"); in getArchTriple()
1220 return Triple("xscale-apple-darwin"); in getArchTriple()
1222 return Triple("armv6-apple-darwin"); in getArchTriple()
1225 *McpuDefault = "cortex-m0"; in getArchTriple()
1226 return Triple("armv6m-apple-darwin"); in getArchTriple()
1228 return Triple("armv7-apple-darwin"); in getArchTriple()
1231 *McpuDefault = "cortex-m4"; in getArchTriple()
1232 return Triple("thumbv7em-apple-darwin"); in getArchTriple()
1234 return Triple("armv7k-apple-darwin"); in getArchTriple()
1237 *McpuDefault = "cortex-m3"; in getArchTriple()
1238 return Triple("thumbv7m-apple-darwin"); in getArchTriple()
1240 return Triple("armv7s-apple-darwin"); in getArchTriple()
1247 return Triple("arm64-apple-darwin"); in getArchTriple()
1254 return Triple("ppc-apple-darwin"); in getArchTriple()
1261 return Triple("ppc64-apple-darwin"); in getArchTriple()
1402 return Stack.back().Start - Trie.begin(); in nodeOffset()
1455 // with the C++ iterator model. The solution is a non-recursive depth first
1533 --RemainingLoopCount; in moveNext()
1551 DEBUG_WITH_TYPE("mach-o-rebase", llvm::dbgs() << "REBASE_OPCODE_DONE\n"); in moveNext()
1556 "mach-o-rebase", in moveNext()
1564 "mach-o-rebase", in moveNext()
1572 DEBUG_WITH_TYPE("mach-o-rebase", in moveNext()
1579 DEBUG_WITH_TYPE("mach-o-rebase", in moveNext()
1586 RemainingLoopCount = ImmValue - 1; in moveNext()
1588 "mach-o-rebase", in moveNext()
1597 RemainingLoopCount = readULEB128() - 1; in moveNext()
1599 "mach-o-rebase", in moveNext()
1610 "mach-o-rebase", in moveNext()
1618 RemainingLoopCount = readULEB128() - 1; in moveNext()
1621 "mach-o-rebase", in moveNext()
1704 --RemainingLoopCount; in moveNext()
1736 DEBUG_WITH_TYPE("mach-o-bind", llvm::dbgs() << "BIND_OPCODE_DONE\n"); in moveNext()
1741 "mach-o-bind", in moveNext()
1748 "mach-o-bind", in moveNext()
1759 "mach-o-bind", in moveNext()
1770 Ptr-SymStart); in moveNext()
1773 "mach-o-bind", in moveNext()
1784 "mach-o-bind", in moveNext()
1793 "mach-o-bind", in moveNext()
1801 "mach-o-bind", in moveNext()
1809 DEBUG_WITH_TYPE("mach-o-bind", in moveNext()
1817 DEBUG_WITH_TYPE("mach-o-bind", in moveNext()
1828 "mach-o-bind", in moveNext()
1840 DEBUG_WITH_TYPE("mach-o-bind", in moveNext()
1847 RemainingLoopCount = readULEB128() - 1; in moveNext()
1852 "mach-o-bind", in moveNext()
1971 return makeArrayRef(Base->sectname); in getSectionRawName()
1979 return makeArrayRef(Base->segname); in getSectionRawFinalSegmentName()
2057 DRI.d.a = SecNum - 1; in getAnyRelocationSection()