Lines Matching refs:LC

30 using LoadCommandPred = std::function<bool(const LoadCommand &LC)>;
33 static bool isLoadCommandWithPayloadString(const LoadCommand &LC) { in isLoadCommandWithPayloadString() argument
36 return LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_RPATH || in isLoadCommandWithPayloadString()
37 LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_ID_DYLIB || in isLoadCommandWithPayloadString()
38 LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_LOAD_DYLIB || in isLoadCommandWithPayloadString()
39 LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_LOAD_WEAK_DYLIB; in isLoadCommandWithPayloadString()
43 static StringRef getPayloadString(const LoadCommand &LC) { in getPayloadString() argument
44 assert(isLoadCommandWithPayloadString(LC) && in getPayloadString()
47 return StringRef(reinterpret_cast<const char *>(LC.Payload.data()), in getPayloadString()
48 LC.Payload.size()) in getPayloadString()
119 static void updateLoadCommandPayloadString(LoadCommand &LC, StringRef S) { in updateLoadCommandPayloadString() argument
120 assert(isLoadCommandWithPayloadString(LC) && in updateLoadCommandPayloadString()
125 LC.MachOLoadCommand.load_command_data.cmdsize = NewCmdsize; in updateLoadCommandPayloadString()
126 LC.Payload.assign(NewCmdsize - sizeof(LCType), 0); in updateLoadCommandPayloadString()
127 std::copy(S.begin(), S.end(), LC.Payload.begin()); in updateLoadCommandPayloadString()
131 LoadCommand LC; in buildRPathLoadCommand() local
136 LC.MachOLoadCommand.rpath_command_data = RPathLC; in buildRPathLoadCommand()
137 LC.Payload.assign(RPathLC.cmdsize - sizeof(MachO::rpath_command), 0); in buildRPathLoadCommand()
138 std::copy(Path.begin(), Path.end(), LC.Payload.begin()); in buildRPathLoadCommand()
139 return LC; in buildRPathLoadCommand()
148 &Config](const LoadCommand &LC) { in processLoadCommands() argument
149 if (LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_RPATH) { in processLoadCommands()
155 StringRef RPath = getPayloadString(LC); in processLoadCommands()
179 for (LoadCommand &LC : Obj.LoadCommands) { in processLoadCommands()
180 if (LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_RPATH) in processLoadCommands()
181 RPaths.insert(getPayloadString(LC)); in processLoadCommands()
198 for (LoadCommand &LC : Obj.LoadCommands) { in processLoadCommands()
199 switch (LC.MachOLoadCommand.load_command_data.cmd) { in processLoadCommands()
203 LC, *Config.SharedLibId); in processLoadCommands()
207 StringRef RPath = getPayloadString(LC); in processLoadCommands()
210 updateLoadCommandPayloadString<MachO::rpath_command>(LC, NewRPath); in processLoadCommands()
218 StringRef InstallName = getPayloadString(LC); in processLoadCommands()
222 updateLoadCommandPayloadString<MachO::dylib_command>(LC, in processLoadCommands()
259 for (LoadCommand &LC : Obj.LoadCommands) in dumpSectionToFile()
260 for (const std::unique_ptr<Section> &Sec : LC.Sections) { in dumpSectionToFile()
293 for (LoadCommand &LC : Obj.LoadCommands) { in addSection()
294 Optional<StringRef> SegName = LC.getSegmentName(); in addSection()
296 uint64_t Addr = *LC.getSegmentVMAddr(); in addSection()
297 for (const std::unique_ptr<Section> &S : LC.Sections) in addSection()
299 LC.Sections.push_back(std::make_unique<Section>(Sec)); in addSection()
300 LC.Sections.back()->Addr = Addr; in addSection()
356 for (LoadCommand &LC : Obj.LoadCommands) in handleArgs()
357 for (std::unique_ptr<Section> &Sec : LC.Sections) in handleArgs()