• Home
  • Raw
  • Download

Lines Matching refs:LC

27 using LoadCommandPred = std::function<bool(const LoadCommand &LC)>;
30 static bool isLoadCommandWithPayloadString(const LoadCommand &LC) { in isLoadCommandWithPayloadString() argument
33 return LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_RPATH || in isLoadCommandWithPayloadString()
34 LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_ID_DYLIB || in isLoadCommandWithPayloadString()
35 LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_LOAD_DYLIB || in isLoadCommandWithPayloadString()
36 LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_LOAD_WEAK_DYLIB; in isLoadCommandWithPayloadString()
40 static StringRef getPayloadString(const LoadCommand &LC) { in getPayloadString() argument
41 assert(isLoadCommandWithPayloadString(LC) && in getPayloadString()
44 return StringRef(reinterpret_cast<const char *>(LC.Payload.data()), in getPayloadString()
45 LC.Payload.size()) in getPayloadString()
112 static void updateLoadCommandPayloadString(LoadCommand &LC, StringRef S) { in updateLoadCommandPayloadString() argument
113 assert(isLoadCommandWithPayloadString(LC) && in updateLoadCommandPayloadString()
118 LC.MachOLoadCommand.load_command_data.cmdsize = NewCmdsize; in updateLoadCommandPayloadString()
119 LC.Payload.assign(NewCmdsize - sizeof(LCType), 0); in updateLoadCommandPayloadString()
120 std::copy(S.begin(), S.end(), LC.Payload.begin()); in updateLoadCommandPayloadString()
124 LoadCommand LC; in buildRPathLoadCommand() local
129 LC.MachOLoadCommand.rpath_command_data = RPathLC; in buildRPathLoadCommand()
130 LC.Payload.assign(RPathLC.cmdsize - sizeof(MachO::rpath_command), 0); in buildRPathLoadCommand()
131 std::copy(Path.begin(), Path.end(), LC.Payload.begin()); in buildRPathLoadCommand()
132 return LC; in buildRPathLoadCommand()
141 &Config](const LoadCommand &LC) { in processLoadCommands() argument
142 if (LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_RPATH) { in processLoadCommands()
148 StringRef RPath = getPayloadString(LC); in processLoadCommands()
172 for (LoadCommand &LC : Obj.LoadCommands) { in processLoadCommands()
173 if (LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_RPATH) in processLoadCommands()
174 RPaths.insert(getPayloadString(LC)); in processLoadCommands()
191 for (LoadCommand &LC : Obj.LoadCommands) { in processLoadCommands()
192 switch (LC.MachOLoadCommand.load_command_data.cmd) { in processLoadCommands()
196 LC, *Config.SharedLibId); in processLoadCommands()
200 StringRef RPath = getPayloadString(LC); in processLoadCommands()
203 updateLoadCommandPayloadString<MachO::rpath_command>(LC, NewRPath); in processLoadCommands()
211 StringRef InstallName = getPayloadString(LC); in processLoadCommands()
215 updateLoadCommandPayloadString<MachO::dylib_command>(LC, in processLoadCommands()
252 for (LoadCommand &LC : Obj.LoadCommands) in dumpSectionToFile()
253 for (const std::unique_ptr<Section> &Sec : LC.Sections) { in dumpSectionToFile()
286 for (LoadCommand &LC : Obj.LoadCommands) { in addSection()
287 Optional<StringRef> SegName = LC.getSegmentName(); in addSection()
289 uint64_t Addr = *LC.getSegmentVMAddr(); in addSection()
290 for (const std::unique_ptr<Section> &S : LC.Sections) in addSection()
292 LC.Sections.push_back(std::make_unique<Section>(Sec)); in addSection()
293 LC.Sections.back()->Addr = Addr; in addSection()
368 for (LoadCommand &LC : Obj.LoadCommands) in handleArgs()
369 for (std::unique_ptr<Section> &Sec : LC.Sections) in handleArgs()