diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-08-30 18:33:37 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-08-30 18:33:37 +0000 |
commit | 9942acab0a42755637a682308c8262b88cbbb9e9 (patch) | |
tree | 62cbc34560be41a62404e071528b9654462c2847 /tools/macho-dump | |
parent | bc6b89ed31ef77098803abe64af94f318ad716bb (diff) |
Teach macho-dump how to dump linkedit_data load commands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138807 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/macho-dump')
-rw-r--r-- | tools/macho-dump/macho-dump.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/macho-dump/macho-dump.cpp b/tools/macho-dump/macho-dump.cpp index f324259a85..e3c3c7cbe6 100644 --- a/tools/macho-dump/macho-dump.cpp +++ b/tools/macho-dump/macho-dump.cpp @@ -310,6 +310,20 @@ static int DumpDysymtabCommand(MachOObject &Obj, return Res; } +static int DumpLinkeditDataCommand(MachOObject &Obj, + const MachOObject::LoadCommandInfo &LCI) { + InMemoryStruct<macho::LinkeditDataLoadCommand> LLC; + Obj.ReadLinkeditDataLoadCommand(LCI, LLC); + if (!LLC) + return Error("unable to read segment load command"); + + outs() << " ('dataoff', " << LLC->DataOffset << ")\n" + << " ('datasize', " << LLC->DataSize << ")\n"; + + return 0; +} + + static int DumpLoadCommand(MachOObject &Obj, unsigned Index) { const MachOObject::LoadCommandInfo &LCI = Obj.getLoadCommandInfo(Index); int Res = 0; @@ -330,6 +344,11 @@ static int DumpLoadCommand(MachOObject &Obj, unsigned Index) { case macho::LCT_Dysymtab: Res = DumpDysymtabCommand(Obj, LCI); break; + case macho::LCT_CodeSignature: + case macho::LCT_SegmentSplitInfo: + case macho::LCT_FunctionStarts: + Res = DumpLinkeditDataCommand(Obj, LCI); + break; default: Warning("unknown load command: " + Twine(LCI.Command.Type)); break; |