Lines Matching refs:MachO

133 void MachObjectWriter::writeHeader(MachO::HeaderFileType Type,  in writeHeader()
140 Flags |= MachO::MH_SUBSECTIONS_VIA_SYMBOLS; in writeHeader()
148 W.write<uint32_t>(is64Bit() ? MachO::MH_MAGIC_64 : MachO::MH_MAGIC); in writeHeader()
160 assert(W.OS.tell() - Start == (is64Bit() ? sizeof(MachO::mach_header_64) in writeHeader()
161 : sizeof(MachO::mach_header))); in writeHeader()
185 is64Bit() ? sizeof(MachO::segment_command_64): in writeSegmentLoadCommand()
186 sizeof(MachO::segment_command); in writeSegmentLoadCommand()
187 W.write<uint32_t>(is64Bit() ? MachO::LC_SEGMENT_64 : MachO::LC_SEGMENT); in writeSegmentLoadCommand()
189 NumSections * (is64Bit() ? sizeof(MachO::section_64) : in writeSegmentLoadCommand()
190 sizeof(MachO::section))); in writeSegmentLoadCommand()
256 (is64Bit() ? sizeof(MachO::section_64) : sizeof(MachO::section))); in writeSection()
268 W.write<uint32_t>(MachO::LC_SYMTAB); in writeSymtabLoadCommand()
269 W.write<uint32_t>(sizeof(MachO::symtab_command)); in writeSymtabLoadCommand()
275 assert(W.OS.tell() - Start == sizeof(MachO::symtab_command)); in writeSymtabLoadCommand()
291 W.write<uint32_t>(MachO::LC_DYSYMTAB); in writeDysymtabLoadCommand()
292 W.write<uint32_t>(sizeof(MachO::dysymtab_command)); in writeDysymtabLoadCommand()
312 assert(W.OS.tell() - Start == sizeof(MachO::dysymtab_command)); in writeDysymtabLoadCommand()
362 Type = MachO::N_INDR; in writeNlist()
364 Type = MachO::N_UNDF; in writeNlist()
366 Type = MachO::N_ABS; in writeNlist()
368 Type = MachO::N_SECT; in writeNlist()
373 Type |= MachO::N_PEXT; in writeNlist()
377 Type |= MachO::N_EXT; in writeNlist()
414 W.write<uint32_t>(sizeof(MachO::linkedit_data_command)); in writeLinkeditLoadCommand()
418 assert(W.OS.tell() - Start == sizeof(MachO::linkedit_data_command)); in writeLinkeditLoadCommand()
424 unsigned Size = sizeof(MachO::linker_option_command); in ComputeLinkerOptionsLoadCommandSize()
437 W.write<uint32_t>(MachO::LC_LINKER_OPTION); in writeLinkerOptionsLoadCommand()
440 uint64_t BytesWritten = sizeof(MachO::linker_option_command); in writeLinkerOptionsLoadCommand()
491 if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
492 Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
493 Section.getType() != MachO::S_THREAD_LOCAL_VARIABLE_POINTERS && in bindIndirectSymbols()
494 Section.getType() != MachO::S_SYMBOL_STUBS) { in bindIndirectSymbols()
507 if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
508 Section.getType() != MachO::S_THREAD_LOCAL_VARIABLE_POINTERS) in bindIndirectSymbols()
523 if (Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
524 Section.getType() != MachO::S_SYMBOL_STUBS) in bindIndirectSymbols()
744 static MachO::LoadCommandType getLCFromMCVM(MCVersionMinType Type) { in getLCFromMCVM()
746 case MCVM_OSXVersionMin: return MachO::LC_VERSION_MIN_MACOSX; in getLCFromMCVM()
747 case MCVM_IOSVersionMin: return MachO::LC_VERSION_MIN_IPHONEOS; in getLCFromMCVM()
748 case MCVM_TvOSVersionMin: return MachO::LC_VERSION_MIN_TVOS; in getLCFromMCVM()
749 case MCVM_WatchOSVersionMin: return MachO::LC_VERSION_MIN_WATCHOS; in getLCFromMCVM()
770 sizeof(MachO::segment_command_64) + NumSections * sizeof(MachO::section_64): in writeObject()
771 sizeof(MachO::segment_command) + NumSections * sizeof(MachO::section); in writeObject()
777 LoadCommandsSize += sizeof(MachO::build_version_command); in writeObject()
779 LoadCommandsSize += sizeof(MachO::version_min_command); in writeObject()
786 LoadCommandsSize += sizeof(MachO::linkedit_data_command); in writeObject()
794 LoadCommandsSize += sizeof(MachO::linkedit_data_command); in writeObject()
802 LoadCommandsSize += (sizeof(MachO::symtab_command) + in writeObject()
803 sizeof(MachO::dysymtab_command)); in writeObject()
814 uint64_t SectionDataStart = (is64Bit() ? sizeof(MachO::mach_header_64) : in writeObject()
815 sizeof(MachO::mach_header)) + LoadCommandsSize; in writeObject()
842 writeHeader(MachO::MH_OBJECT, NumLoadCommands, LoadCommandsSize, in writeObject()
845 MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | MachO::VM_PROT_EXECUTE; in writeObject()
858 Flags |= MachO::S_ATTR_SOME_INSTRUCTIONS; in writeObject()
861 RelocTableEnd += NumRelocs * sizeof(MachO::any_relocation_info); in writeObject()
882 W.write<uint32_t>(MachO::LC_BUILD_VERSION); in writeObject()
883 W.write<uint32_t>(sizeof(MachO::build_version_command)); in writeObject()
889 MachO::LoadCommandType LCType in writeObject()
892 W.write<uint32_t>(sizeof(MachO::version_min_command)); in writeObject()
903 writeLinkeditLoadCommand(MachO::LC_DATA_IN_CODE, DataRegionsOffset, in writeObject()
910 writeLinkeditLoadCommand(MachO::LC_LINKER_OPTIMIZATION_HINT, in writeObject()
937 sizeof(MachO::nlist_64) : in writeObject()
938 sizeof(MachO::nlist)); in writeObject()
1018 if (Section.getType() == MachO::S_NON_LAZY_SYMBOL_POINTERS) { in writeObject()
1021 uint32_t Flags = MachO::INDIRECT_SYMBOL_LOCAL; in writeObject()
1023 Flags |= MachO::INDIRECT_SYMBOL_ABS; in writeObject()