llvm.org GIT mirror llvm / 595bd8b
Print dylib load kind (weak, reexport, etc) in llvm-objdump -m -dylibs-used Summary: Historically llvm-objdump prints the path to a dylib as well as the dylib's compatibility version and current version number. This change extends this information by adding the kind of dylib load: weak, reexport, etc. rdar://51383512 Reviewers: pete, lhames Reviewed By: pete Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62866 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363746 91177308-0d34-0410-b5e6-96231b3b80d8 Michael Trent 28 days ago
2 changed file(s) with 17 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
None RUN: llvm-objdump -m -dylibs-used %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s -check-prefix=USED
1 RUN: llvm-objdump -m -dylib-id %p/Inputs/dylibLoadKinds.macho-x86_64 | FileCheck %s -check-prefix=ID
2 RUN: llvm-objdump -m -dylib-id -no-leading-headers %p/Inputs/dylibLoadKinds.macho-x86_64 | FileCheck %s -check-prefix=IDNOHEADERS
3
0 RUN: llvm-objdump -m -dylibs-used %p/Inputs/dylibLoadKinds.macho-x86_64 | FileCheck %s -check-prefix=USED
1 USED: /usr/lib/foo1.dylib (compatibility version 0.0.0, current version 0.0.0)
2 USED: /usr/lib/foo2.dylib (compatibility version 0.0.0, current version 0.0.0, weak)
3 USED: /usr/lib/foo3.dylib (compatibility version 0.0.0, current version 0.0.0, reexport)
4 USED: /usr/lib/foo4.dylib (compatibility version 0.0.0, current version 0.0.0, lazy)
45 USED: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
56
7 RUN: llvm-objdump -m -dylib-id %p/Inputs/dylibLoadKinds.macho-x86_64 | FileCheck %s -check-prefix=ID
68 ID: /usr/lib/foo.dylib
79
10 RUN: llvm-objdump -m -dylib-id -no-leading-headers %p/Inputs/dylibLoadKinds.macho-x86_64 | FileCheck %s -check-prefix=IDNOHEADERS
811 IDNOHEADERS-NOT: dylibLoadKinds.macho-x86_64:
912 IDNOHEADERS: /usr/lib/foo.dylib
12051205 outs() << " current version "
12061206 << ((dl.dylib.current_version >> 16) & 0xffff) << "."
12071207 << ((dl.dylib.current_version >> 8) & 0xff) << "."
1208 << (dl.dylib.current_version & 0xff) << ")\n";
1208 << (dl.dylib.current_version & 0xff);
1209 if (Load.C.cmd == MachO::LC_LOAD_WEAK_DYLIB)
1210 outs() << ", weak";
1211 if (Load.C.cmd == MachO::LC_REEXPORT_DYLIB)
1212 outs() << ", reexport";
1213 if (Load.C.cmd == MachO::LC_LOAD_UPWARD_DYLIB)
1214 outs() << ", upward";
1215 if (Load.C.cmd == MachO::LC_LAZY_LOAD_DYLIB)
1216 outs() << ", lazy";
1217 outs() << ")\n";
12091218 }
12101219 } else {
12111220 outs() << "\tBad offset (" << dl.dylib.name << ") for name of ";