llvm.org GIT mirror llvm / 12a261e
macho-dump: add code to print LC_ID_DYLIB load commands. I want to check them in lld. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212043 91177308-0d34-0410-b5e6-96231b3b80d8 Tim Northover 6 years ago
3 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
200200 getLinkerOptionsLoadCommand(const LoadCommandInfo &L) const;
201201 MachO::version_min_command
202202 getVersionMinLoadCommand(const LoadCommandInfo &L) const;
203 MachO::dylib_command
204 getDylibIDLoadCommand(const LoadCommandInfo &L) const;
203205
204206 MachO::any_relocation_info getRelocation(DataRefImpl Rel) const;
205207 MachO::data_in_code_entry getDice(DataRefImpl Rel) const;
17201720 return getStruct(this, L.Ptr);
17211721 }
17221722
1723 MachO::dylib_command
1724 MachOObjectFile::getDylibIDLoadCommand(const LoadCommandInfo &L) const {
1725 return getStruct(this, L.Ptr);
1726 }
1727
1728
17231729 MachO::any_relocation_info
17241730 MachOObjectFile::getRelocation(DataRefImpl Rel) const {
17251731 DataRefImpl Sec;
327327 return 0;
328328 }
329329
330 static int
331 DumpDylibID(const MachOObjectFile &Obj,
332 const MachOObjectFile::LoadCommandInfo &LCI) {
333 MachO::dylib_command DLLC = Obj.getDylibIDLoadCommand(LCI);
334 outs() << " ('install_name', '" << LCI.Ptr + DLLC.dylib.name << "')\n"
335 << " ('timestamp, " << DLLC.dylib.timestamp << ")\n"
336 << " ('cur_version, " << DLLC.dylib.current_version << ")\n"
337 << " ('compat_version, " << DLLC.dylib.compatibility_version << ")\n";
338 return 0;
339 }
340
330341 static int DumpLoadCommand(const MachOObjectFile &Obj,
331342 MachOObjectFile::LoadCommandInfo &LCI) {
332343 switch (LCI.C.cmd) {
349360 case MachO::LC_VERSION_MIN_IPHONEOS:
350361 case MachO::LC_VERSION_MIN_MACOSX:
351362 return DumpVersionMin(Obj, LCI);
363 case MachO::LC_ID_DYLIB:
364 return DumpDylibID(Obj, LCI);
352365 default:
353366 Warning("unknown load command: " + Twine(LCI.C.cmd));
354367 return 0;