mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-26 10:29:36 +00:00
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
This commit is contained in:
parent
a1ff0aed40
commit
12a261e117
@ -201,6 +201,8 @@ public:
|
|||||||
getLinkerOptionsLoadCommand(const LoadCommandInfo &L) const;
|
getLinkerOptionsLoadCommand(const LoadCommandInfo &L) const;
|
||||||
MachO::version_min_command
|
MachO::version_min_command
|
||||||
getVersionMinLoadCommand(const LoadCommandInfo &L) const;
|
getVersionMinLoadCommand(const LoadCommandInfo &L) const;
|
||||||
|
MachO::dylib_command
|
||||||
|
getDylibIDLoadCommand(const LoadCommandInfo &L) const;
|
||||||
|
|
||||||
MachO::any_relocation_info getRelocation(DataRefImpl Rel) const;
|
MachO::any_relocation_info getRelocation(DataRefImpl Rel) const;
|
||||||
MachO::data_in_code_entry getDice(DataRefImpl Rel) const;
|
MachO::data_in_code_entry getDice(DataRefImpl Rel) const;
|
||||||
|
@ -1721,6 +1721,12 @@ MachOObjectFile::getVersionMinLoadCommand(const LoadCommandInfo &L) const {
|
|||||||
return getStruct<MachO::version_min_command>(this, L.Ptr);
|
return getStruct<MachO::version_min_command>(this, L.Ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MachO::dylib_command
|
||||||
|
MachOObjectFile::getDylibIDLoadCommand(const LoadCommandInfo &L) const {
|
||||||
|
return getStruct<MachO::dylib_command>(this, L.Ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MachO::any_relocation_info
|
MachO::any_relocation_info
|
||||||
MachOObjectFile::getRelocation(DataRefImpl Rel) const {
|
MachOObjectFile::getRelocation(DataRefImpl Rel) const {
|
||||||
DataRefImpl Sec;
|
DataRefImpl Sec;
|
||||||
|
@ -328,6 +328,17 @@ DumpVersionMin(const MachOObjectFile &Obj,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
DumpDylibID(const MachOObjectFile &Obj,
|
||||||
|
const MachOObjectFile::LoadCommandInfo &LCI) {
|
||||||
|
MachO::dylib_command DLLC = Obj.getDylibIDLoadCommand(LCI);
|
||||||
|
outs() << " ('install_name', '" << LCI.Ptr + DLLC.dylib.name << "')\n"
|
||||||
|
<< " ('timestamp, " << DLLC.dylib.timestamp << ")\n"
|
||||||
|
<< " ('cur_version, " << DLLC.dylib.current_version << ")\n"
|
||||||
|
<< " ('compat_version, " << DLLC.dylib.compatibility_version << ")\n";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int DumpLoadCommand(const MachOObjectFile &Obj,
|
static int DumpLoadCommand(const MachOObjectFile &Obj,
|
||||||
MachOObjectFile::LoadCommandInfo &LCI) {
|
MachOObjectFile::LoadCommandInfo &LCI) {
|
||||||
switch (LCI.C.cmd) {
|
switch (LCI.C.cmd) {
|
||||||
@ -350,6 +361,8 @@ static int DumpLoadCommand(const MachOObjectFile &Obj,
|
|||||||
case MachO::LC_VERSION_MIN_IPHONEOS:
|
case MachO::LC_VERSION_MIN_IPHONEOS:
|
||||||
case MachO::LC_VERSION_MIN_MACOSX:
|
case MachO::LC_VERSION_MIN_MACOSX:
|
||||||
return DumpVersionMin(Obj, LCI);
|
return DumpVersionMin(Obj, LCI);
|
||||||
|
case MachO::LC_ID_DYLIB:
|
||||||
|
return DumpDylibID(Obj, LCI);
|
||||||
default:
|
default:
|
||||||
Warning("unknown load command: " + Twine(LCI.C.cmd));
|
Warning("unknown load command: " + Twine(LCI.C.cmd));
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user