Lines Matching refs:MachO
135 void MachObjectWriter::writeHeader(MachO::HeaderFileType Type, in writeHeader()
142 Flags |= MachO::MH_SUBSECTIONS_VIA_SYMBOLS; in writeHeader()
150 W.write<uint32_t>(is64Bit() ? MachO::MH_MAGIC_64 : MachO::MH_MAGIC); in writeHeader()
162 assert(W.OS.tell() - Start == (is64Bit() ? sizeof(MachO::mach_header_64) in writeHeader()
163 : sizeof(MachO::mach_header))); in writeHeader()
187 is64Bit() ? sizeof(MachO::segment_command_64): in writeSegmentLoadCommand()
188 sizeof(MachO::segment_command); in writeSegmentLoadCommand()
189 W.write<uint32_t>(is64Bit() ? MachO::LC_SEGMENT_64 : MachO::LC_SEGMENT); in writeSegmentLoadCommand()
191 NumSections * (is64Bit() ? sizeof(MachO::section_64) : in writeSegmentLoadCommand()
192 sizeof(MachO::section))); in writeSegmentLoadCommand()
258 (is64Bit() ? sizeof(MachO::section_64) : sizeof(MachO::section))); in writeSection()
270 W.write<uint32_t>(MachO::LC_SYMTAB); in writeSymtabLoadCommand()
271 W.write<uint32_t>(sizeof(MachO::symtab_command)); in writeSymtabLoadCommand()
277 assert(W.OS.tell() - Start == sizeof(MachO::symtab_command)); in writeSymtabLoadCommand()
293 W.write<uint32_t>(MachO::LC_DYSYMTAB); in writeDysymtabLoadCommand()
294 W.write<uint32_t>(sizeof(MachO::dysymtab_command)); in writeDysymtabLoadCommand()
314 assert(W.OS.tell() - Start == sizeof(MachO::dysymtab_command)); in writeDysymtabLoadCommand()
364 Type = MachO::N_INDR; in writeNlist()
366 Type = MachO::N_UNDF; in writeNlist()
368 Type = MachO::N_ABS; in writeNlist()
370 Type = MachO::N_SECT; in writeNlist()
375 Type |= MachO::N_PEXT; in writeNlist()
379 Type |= MachO::N_EXT; in writeNlist()
416 W.write<uint32_t>(sizeof(MachO::linkedit_data_command)); in writeLinkeditLoadCommand()
420 assert(W.OS.tell() - Start == sizeof(MachO::linkedit_data_command)); in writeLinkeditLoadCommand()
426 unsigned Size = sizeof(MachO::linker_option_command); in ComputeLinkerOptionsLoadCommandSize()
439 W.write<uint32_t>(MachO::LC_LINKER_OPTION); in writeLinkerOptionsLoadCommand()
442 uint64_t BytesWritten = sizeof(MachO::linker_option_command); in writeLinkerOptionsLoadCommand()
493 if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
494 Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
495 Section.getType() != MachO::S_THREAD_LOCAL_VARIABLE_POINTERS && in bindIndirectSymbols()
496 Section.getType() != MachO::S_SYMBOL_STUBS) { in bindIndirectSymbols()
509 if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
510 Section.getType() != MachO::S_THREAD_LOCAL_VARIABLE_POINTERS) in bindIndirectSymbols()
525 if (Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
526 Section.getType() != MachO::S_SYMBOL_STUBS) in bindIndirectSymbols()
746 static MachO::LoadCommandType getLCFromMCVM(MCVersionMinType Type) { in getLCFromMCVM()
748 case MCVM_OSXVersionMin: return MachO::LC_VERSION_MIN_MACOSX; in getLCFromMCVM()
749 case MCVM_IOSVersionMin: return MachO::LC_VERSION_MIN_IPHONEOS; in getLCFromMCVM()
750 case MCVM_TvOSVersionMin: return MachO::LC_VERSION_MIN_TVOS; in getLCFromMCVM()
751 case MCVM_WatchOSVersionMin: return MachO::LC_VERSION_MIN_WATCHOS; in getLCFromMCVM()
761 MachO::any_relocation_info MRE; in populateAddrSigSection()
763 MRE.r_word1 = (Log2Size << 25) | (MachO::GENERIC_RELOC_VANILLA << 28); in populateAddrSigSection()
803 sizeof(MachO::segment_command_64) + NumSections * sizeof(MachO::section_64): in writeObject()
804 sizeof(MachO::segment_command) + NumSections * sizeof(MachO::section); in writeObject()
810 LoadCommandsSize += sizeof(MachO::build_version_command); in writeObject()
812 LoadCommandsSize += sizeof(MachO::version_min_command); in writeObject()
823 LoadCommandsSize += sizeof(MachO::build_version_command); in writeObject()
830 LoadCommandsSize += sizeof(MachO::linkedit_data_command); in writeObject()
838 LoadCommandsSize += sizeof(MachO::linkedit_data_command); in writeObject()
846 LoadCommandsSize += (sizeof(MachO::symtab_command) + in writeObject()
847 sizeof(MachO::dysymtab_command)); in writeObject()
858 uint64_t SectionDataStart = (is64Bit() ? sizeof(MachO::mach_header_64) : in writeObject()
859 sizeof(MachO::mach_header)) + LoadCommandsSize; in writeObject()
886 writeHeader(MachO::MH_OBJECT, NumLoadCommands, LoadCommandsSize, in writeObject()
889 MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | MachO::VM_PROT_EXECUTE; in writeObject()
902 Flags |= MachO::S_ATTR_SOME_INSTRUCTIONS; in writeObject()
905 RelocTableEnd += NumRelocs * sizeof(MachO::any_relocation_info); in writeObject()
927 W.write<uint32_t>(MachO::LC_BUILD_VERSION); in writeObject()
928 W.write<uint32_t>(sizeof(MachO::build_version_command)); in writeObject()
934 MachO::LoadCommandType LCType = in writeObject()
937 W.write<uint32_t>(sizeof(MachO::version_min_command)); in writeObject()
952 writeLinkeditLoadCommand(MachO::LC_DATA_IN_CODE, DataRegionsOffset, in writeObject()
959 writeLinkeditLoadCommand(MachO::LC_LINKER_OPTIMIZATION_HINT, in writeObject()
986 sizeof(MachO::nlist_64) : in writeObject()
987 sizeof(MachO::nlist)); in writeObject()
1067 if (Section.getType() == MachO::S_NON_LAZY_SYMBOL_POINTERS) { in writeObject()
1070 uint32_t Flags = MachO::INDIRECT_SYMBOL_LOCAL; in writeObject()
1072 Flags |= MachO::INDIRECT_SYMBOL_ABS; in writeObject()