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()
257 (is64Bit() ? sizeof(MachO::section_64) : sizeof(MachO::section))); in writeSection()
269 W.write<uint32_t>(MachO::LC_SYMTAB); in writeSymtabLoadCommand()
270 W.write<uint32_t>(sizeof(MachO::symtab_command)); in writeSymtabLoadCommand()
276 assert(W.OS.tell() - Start == sizeof(MachO::symtab_command)); in writeSymtabLoadCommand()
292 W.write<uint32_t>(MachO::LC_DYSYMTAB); in writeDysymtabLoadCommand()
293 W.write<uint32_t>(sizeof(MachO::dysymtab_command)); in writeDysymtabLoadCommand()
313 assert(W.OS.tell() - Start == sizeof(MachO::dysymtab_command)); in writeDysymtabLoadCommand()
363 Type = MachO::N_INDR; in writeNlist()
365 Type = MachO::N_UNDF; in writeNlist()
367 Type = MachO::N_ABS; in writeNlist()
369 Type = MachO::N_SECT; in writeNlist()
374 Type |= MachO::N_PEXT; in writeNlist()
378 Type |= MachO::N_EXT; in writeNlist()
415 W.write<uint32_t>(sizeof(MachO::linkedit_data_command)); in writeLinkeditLoadCommand()
419 assert(W.OS.tell() - Start == sizeof(MachO::linkedit_data_command)); in writeLinkeditLoadCommand()
425 unsigned Size = sizeof(MachO::linker_option_command); in ComputeLinkerOptionsLoadCommandSize()
438 W.write<uint32_t>(MachO::LC_LINKER_OPTION); in writeLinkerOptionsLoadCommand()
441 uint64_t BytesWritten = sizeof(MachO::linker_option_command); in writeLinkerOptionsLoadCommand()
492 if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
493 Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
494 Section.getType() != MachO::S_THREAD_LOCAL_VARIABLE_POINTERS && in bindIndirectSymbols()
495 Section.getType() != MachO::S_SYMBOL_STUBS) { in bindIndirectSymbols()
508 if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
509 Section.getType() != MachO::S_THREAD_LOCAL_VARIABLE_POINTERS) in bindIndirectSymbols()
524 if (Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS && in bindIndirectSymbols()
525 Section.getType() != MachO::S_SYMBOL_STUBS) in bindIndirectSymbols()
733 static MachO::LoadCommandType getLCFromMCVM(MCVersionMinType Type) { in getLCFromMCVM()
735 case MCVM_OSXVersionMin: return MachO::LC_VERSION_MIN_MACOSX; in getLCFromMCVM()
736 case MCVM_IOSVersionMin: return MachO::LC_VERSION_MIN_IPHONEOS; in getLCFromMCVM()
737 case MCVM_TvOSVersionMin: return MachO::LC_VERSION_MIN_TVOS; in getLCFromMCVM()
738 case MCVM_WatchOSVersionMin: return MachO::LC_VERSION_MIN_WATCHOS; in getLCFromMCVM()
750 MachO::any_relocation_info MRE; in populateAddrSigSection()
752 MRE.r_word1 = (Log2Size << 25) | (MachO::GENERIC_RELOC_VANILLA << 28); in populateAddrSigSection()
792 sizeof(MachO::segment_command_64) + NumSections * sizeof(MachO::section_64): in writeObject()
793 sizeof(MachO::segment_command) + NumSections * sizeof(MachO::section); in writeObject()
799 LoadCommandsSize += sizeof(MachO::build_version_command); in writeObject()
801 LoadCommandsSize += sizeof(MachO::version_min_command); in writeObject()
812 LoadCommandsSize += sizeof(MachO::build_version_command); in writeObject()
819 LoadCommandsSize += sizeof(MachO::linkedit_data_command); in writeObject()
827 LoadCommandsSize += sizeof(MachO::linkedit_data_command); in writeObject()
835 LoadCommandsSize += (sizeof(MachO::symtab_command) + in writeObject()
836 sizeof(MachO::dysymtab_command)); in writeObject()
847 uint64_t SectionDataStart = (is64Bit() ? sizeof(MachO::mach_header_64) : in writeObject()
848 sizeof(MachO::mach_header)) + LoadCommandsSize; in writeObject()
875 writeHeader(MachO::MH_OBJECT, NumLoadCommands, LoadCommandsSize, in writeObject()
878 MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | MachO::VM_PROT_EXECUTE; in writeObject()
891 Flags |= MachO::S_ATTR_SOME_INSTRUCTIONS; in writeObject()
894 RelocTableEnd += NumRelocs * sizeof(MachO::any_relocation_info); in writeObject()
916 W.write<uint32_t>(MachO::LC_BUILD_VERSION); in writeObject()
917 W.write<uint32_t>(sizeof(MachO::build_version_command)); in writeObject()
923 MachO::LoadCommandType LCType = in writeObject()
926 W.write<uint32_t>(sizeof(MachO::version_min_command)); in writeObject()
941 writeLinkeditLoadCommand(MachO::LC_DATA_IN_CODE, DataRegionsOffset, in writeObject()
948 writeLinkeditLoadCommand(MachO::LC_LINKER_OPTIMIZATION_HINT, in writeObject()
975 sizeof(MachO::nlist_64) : in writeObject()
976 sizeof(MachO::nlist)); in writeObject()
1056 if (Section.getType() == MachO::S_NON_LAZY_SYMBOL_POINTERS) { in writeObject()
1059 uint32_t Flags = MachO::INDIRECT_SYMBOL_LOCAL; in writeObject()
1061 Flags |= MachO::INDIRECT_SYMBOL_ABS; in writeObject()