Lines Matching full:mlc
29 const MachO::macho_load_command &MLC = LC.MachOLoadCommand;
30 auto cmd = MLC.load_command_data.cmd;
68 void MachOLayoutBuilder::updateDySymTab(MachO::macho_load_command &MLC) {
69 assert(MLC.load_command_data.cmd == MachO::LC_DYSYMTAB);
102 MLC.dysymtab_command_data.ilocalsym = 0;
103 MLC.dysymtab_command_data.nlocalsym = NumLocalSymbols;
104 MLC.dysymtab_command_data.iextdefsym = NumLocalSymbols;
105 MLC.dysymtab_command_data.nextdefsym = NumExtDefSymbols;
106 MLC.dysymtab_command_data.iundefsym = NumLocalSymbols + NumExtDefSymbols;
107 MLC.dysymtab_command_data.nundefsym =
120 auto &MLC = LC.MachOLoadCommand;
124 switch (MLC.load_command_data.cmd) {
126 SegmentVmAddr = MLC.segment_command_data.vmaddr;
127 SegmentVmSize = MLC.segment_command_data.vmsize;
128 Segname = StringRef(MLC.segment_command_data.segname,
129 strnlen(MLC.segment_command_data.segname,
130 sizeof(MLC.segment_command_data.segname)));
133 SegmentVmAddr = MLC.segment_command_64_data.vmaddr;
134 SegmentVmSize = MLC.segment_command_64_data.vmsize;
135 Segname = StringRef(MLC.segment_command_64_data.segname,
136 strnlen(MLC.segment_command_64_data.segname,
137 sizeof(MLC.segment_command_64_data.segname)));
146 LinkEditLoadCommand = &MLC;
190 switch (MLC.load_command_data.cmd) {
192 MLC.segment_command_data.cmdsize =
195 MLC.segment_command_data.nsects = LC.Sections.size();
196 MLC.segment_command_data.fileoff = SegOffset;
197 MLC.segment_command_data.vmsize = VMSize;
198 MLC.segment_command_data.filesize = SegFileSize;
201 MLC.segment_command_64_data.cmdsize =
204 MLC.segment_command_64_data.nsects = LC.Sections.size();
205 MLC.segment_command_64_data.fileoff = SegOffset;
206 MLC.segment_command_64_data.vmsize = VMSize;
207 MLC.segment_command_64_data.filesize = SegFileSize;
320 MachO::macho_load_command *MLC = LinkEditLoadCommand;
323 MLC->segment_command_data.cmdsize = sizeof(MachO::segment_command);
324 MLC->segment_command_data.fileoff = StartOfLinkEdit;
325 MLC->segment_command_data.vmsize = alignTo(LinkEditSize, PageSize);
326 MLC->segment_command_data.filesize = LinkEditSize;
329 MLC->segment_command_64_data.cmdsize = sizeof(MachO::segment_command_64);
330 MLC->segment_command_64_data.fileoff = StartOfLinkEdit;
331 MLC->segment_command_64_data.vmsize = alignTo(LinkEditSize, PageSize);
332 MLC->segment_command_64_data.filesize = LinkEditSize;
338 auto &MLC = LC.MachOLoadCommand;
339 auto cmd = MLC.load_command_data.cmd;
342 MLC.linkedit_data_command_data.dataoff = StartOfCodeSignature;
343 MLC.linkedit_data_command_data.datasize = CodeSignatureSize;
346 MLC.linkedit_data_command_data.dataoff = StartOfDylibCodeSignDRs;
347 MLC.linkedit_data_command_data.datasize = O.DylibCodeSignDRs.Data.size();
350 MLC.symtab_command_data.symoff = StartOfSymbols;
351 MLC.symtab_command_data.nsyms = O.SymTable.Symbols.size();
352 MLC.symtab_command_data.stroff = StartOfSymbolStrings;
353 MLC.symtab_command_data.strsize = StrTableBuilder.getSize();
356 if (MLC.dysymtab_command_data.ntoc != 0 ||
357 MLC.dysymtab_command_data.nmodtab != 0 ||
358 MLC.dysymtab_command_data.nextrefsyms != 0 ||
359 MLC.dysymtab_command_data.nlocrel != 0 ||
360 MLC.dysymtab_command_data.nextrel != 0)
365 MLC.dysymtab_command_data.indirectsymoff = StartOfIndirectSymbols;
366 MLC.dysymtab_command_data.nindirectsyms =
370 updateDySymTab(MLC);
374 MLC.linkedit_data_command_data.dataoff = StartOfDataInCode;
375 MLC.linkedit_data_command_data.datasize = O.DataInCode.Data.size();
378 MLC.linkedit_data_command_data.dataoff = StartOfLinkerOptimizationHint;
379 MLC.linkedit_data_command_data.datasize =
383 MLC.linkedit_data_command_data.dataoff = StartOfFunctionStarts;
384 MLC.linkedit_data_command_data.datasize = O.FunctionStarts.Data.size();
387 MLC.linkedit_data_command_data.dataoff = StartOfChainedFixups;
388 MLC.linkedit_data_command_data.datasize = O.ChainedFixups.Data.size();
391 MLC.linkedit_data_command_data.dataoff = StartOfDyldExportsTrie;
392 MLC.linkedit_data_command_data.datasize = DyldExportsTrieSize;
396 MLC.dyld_info_command_data.rebase_off =
398 MLC.dyld_info_command_data.rebase_size = O.Rebases.Opcodes.size();
399 MLC.dyld_info_command_data.bind_off =
401 MLC.dyld_info_command_data.bind_size = O.Binds.Opcodes.size();
402 MLC.dyld_info_command_data.weak_bind_off =
404 MLC.dyld_info_command_data.weak_bind_size = O.WeakBinds.Opcodes.size();
405 MLC.dyld_info_command_data.lazy_bind_off =
407 MLC.dyld_info_command_data.lazy_bind_size = O.LazyBinds.Opcodes.size();
408 MLC.dyld_info_command_data.export_off =
410 MLC.dyld_info_command_data.export_size = DyldInfoExportsTrieSize;