Lines Matching refs:MachO
132 void MachObjectWriter::writeHeader(MachO::HeaderFileType Type, in writeHeader()
139 Flags |= MachO::MH_SUBSECTIONS_VIA_SYMBOLS; in writeHeader()
147 W.write<uint32_t>(is64Bit() ? MachO::MH_MAGIC_64 : MachO::MH_MAGIC); in writeHeader()
159 assert(W.OS.tell() - Start == (is64Bit() ? sizeof(MachO::mach_header_64) in writeHeader()
160 : sizeof(MachO::mach_header))); in writeHeader()
184 is64Bit() ? sizeof(MachO::segment_command_64): in writeSegmentLoadCommand()
185 sizeof(MachO::segment_command); in writeSegmentLoadCommand()
186 W.write<uint32_t>(is64Bit() ? MachO::LC_SEGMENT_64 : MachO::LC_SEGMENT); in writeSegmentLoadCommand()
188 NumSections * (is64Bit() ? sizeof(MachO::section_64) : in writeSegmentLoadCommand()
189 sizeof(MachO::section))); in writeSegmentLoadCommand()
255 (is64Bit() ? sizeof(MachO::section_64) : sizeof(MachO::section))); in writeSection()
267 W.write<uint32_t>(MachO::LC_SYMTAB); in writeSymtabLoadCommand()
268 W.write<uint32_t>(sizeof(MachO::symtab_command)); in writeSymtabLoadCommand()
274 assert(W.OS.tell() - Start == sizeof(MachO::symtab_command)); in writeSymtabLoadCommand()
290 W.write<uint32_t>(MachO::LC_DYSYMTAB); in writeDysymtabLoadCommand()
291 W.write<uint32_t>(sizeof(MachO::dysymtab_command)); in writeDysymtabLoadCommand()
311 assert(W.OS.tell() - Start == sizeof(MachO::dysymtab_command)); in writeDysymtabLoadCommand()
361 Type = MachO::N_INDR; in writeNlist()
363 Type = MachO::N_UNDF; in writeNlist()
365 Type = MachO::N_ABS; in writeNlist()
367 Type = MachO::N_SECT; in writeNlist()
372 Type |= MachO::N_PEXT; in writeNlist()
376 Type |= MachO::N_EXT; in writeNlist()
413 W.write<uint32_t>(sizeof(MachO::linkedit_data_command)); in writeLinkeditLoadCommand()
417 assert(W.OS.tell() - Start == sizeof(MachO::linkedit_data_command)); in writeLinkeditLoadCommand()
423 unsigned Size = sizeof(MachO::linker_option_command); in ComputeLinkerOptionsLoadCommandSize()
436 W.write<uint32_t>(MachO::LC_LINKER_OPTION); in writeLinkerOptionsLoadCommand()
439 uint64_t BytesWritten = sizeof(MachO::linker_option_command); in writeLinkerOptionsLoadCommand()
475 if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
476 Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
477 Section.getType() != MachO::S_THREAD_LOCAL_VARIABLE_POINTERS && in bindIndirectSymbols()
478 Section.getType() != MachO::S_SYMBOL_STUBS) { in bindIndirectSymbols()
491 if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
492 Section.getType() != MachO::S_THREAD_LOCAL_VARIABLE_POINTERS) in bindIndirectSymbols()
507 if (Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
508 Section.getType() != MachO::S_SYMBOL_STUBS) in bindIndirectSymbols()
728 static MachO::LoadCommandType getLCFromMCVM(MCVersionMinType Type) { in getLCFromMCVM()
730 case MCVM_OSXVersionMin: return MachO::LC_VERSION_MIN_MACOSX; in getLCFromMCVM()
731 case MCVM_IOSVersionMin: return MachO::LC_VERSION_MIN_IPHONEOS; in getLCFromMCVM()
732 case MCVM_TvOSVersionMin: return MachO::LC_VERSION_MIN_TVOS; in getLCFromMCVM()
733 case MCVM_WatchOSVersionMin: return MachO::LC_VERSION_MIN_WATCHOS; in getLCFromMCVM()
754 sizeof(MachO::segment_command_64) + NumSections * sizeof(MachO::section_64): in writeObject()
755 sizeof(MachO::segment_command) + NumSections * sizeof(MachO::section); in writeObject()
761 LoadCommandsSize += sizeof(MachO::build_version_command); in writeObject()
763 LoadCommandsSize += sizeof(MachO::version_min_command); in writeObject()
770 LoadCommandsSize += sizeof(MachO::linkedit_data_command); in writeObject()
778 LoadCommandsSize += sizeof(MachO::linkedit_data_command); in writeObject()
786 LoadCommandsSize += (sizeof(MachO::symtab_command) + in writeObject()
787 sizeof(MachO::dysymtab_command)); in writeObject()
798 uint64_t SectionDataStart = (is64Bit() ? sizeof(MachO::mach_header_64) : in writeObject()
799 sizeof(MachO::mach_header)) + LoadCommandsSize; in writeObject()
825 writeHeader(MachO::MH_OBJECT, NumLoadCommands, LoadCommandsSize, in writeObject()
828 MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | MachO::VM_PROT_EXECUTE; in writeObject()
841 Flags |= MachO::S_ATTR_SOME_INSTRUCTIONS; in writeObject()
844 RelocTableEnd += NumRelocs * sizeof(MachO::any_relocation_info); in writeObject()
865 W.write<uint32_t>(MachO::LC_BUILD_VERSION); in writeObject()
866 W.write<uint32_t>(sizeof(MachO::build_version_command)); in writeObject()
872 MachO::LoadCommandType LCType in writeObject()
875 W.write<uint32_t>(sizeof(MachO::version_min_command)); in writeObject()
886 writeLinkeditLoadCommand(MachO::LC_DATA_IN_CODE, DataRegionsOffset, in writeObject()
893 writeLinkeditLoadCommand(MachO::LC_LINKER_OPTIMIZATION_HINT, in writeObject()
920 sizeof(MachO::nlist_64) : in writeObject()
921 sizeof(MachO::nlist)); in writeObject()
1000 if (Section.getType() == MachO::S_NON_LAZY_SYMBOL_POINTERS) { in writeObject()
1003 uint32_t Flags = MachO::INDIRECT_SYMBOL_LOCAL; in writeObject()
1005 Flags |= MachO::INDIRECT_SYMBOL_ABS; in writeObject()