llvm.org GIT mirror llvm / 26272de
Add the -just-symbol-name (aka -j) flag to llvm-nm to just print the symbol’s name. On darwin the -j flag is used (often in combinations with other flags) to produce a complete list of symbol names which than can then be reorder and used with ld(1)’s -order_file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212294 91177308-0d34-0410-b5e6-96231b3b80d8 Kevin Enderby 6 years ago
2 changed file(s) with 17 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1717 RUN: | FileCheck %s -check-prefix macho64
1818 RUN: llvm-nm %p/Inputs/macho-text-data-bss.macho-x86_64 \
1919 RUN: | FileCheck %s -check-prefix macho-tdb
20 RUN: llvm-nm -j %p/Inputs/macho-text-data-bss.macho-x86_64 \
21 RUN: | FileCheck %s -check-prefix macho-j
2022 RUN: llvm-nm -r %p/Inputs/macho-text-data-bss.macho-x86_64 \
2123 RUN: | FileCheck %s -check-prefix macho-r
2224 RUN: llvm-nm %p/Inputs/common.coff-i386 \
8486 macho-tdb: 0000000000000000 T _t
8587 macho-tdb: 0000000000000048 S _t.eh
8688
89 macho-j: EH_frame0
90 macho-j: _b
91 macho-j: _d
92 macho-j: _t
93 macho-j: _t.eh
94
8795 macho-r: 0000000000000048 S _t.eh
8896 macho-r-NEXT: 0000000000000000 T _t
8997 macho-r-NEXT: 000000000000000c D _d
130130 cl::opt ArchiveMap("print-armap", cl::desc("Print the archive map"));
131131 cl::alias ArchiveMaps("s", cl::desc("Alias for --print-armap"),
132132 cl::aliasopt(ArchiveMap));
133
134 cl::opt JustSymbolName("just-symbol-name",
135 cl::desc("Print just the symbol's name"));
136 cl::alias JustSymbolNames("j", cl::desc("Alias for --just-symbol-name"),
137 cl::aliasopt(JustSymbolName));
133138 bool PrintAddress = true;
134139
135140 bool MultipleFiles = false;
445450 continue;
446451 if (SizeSort && !PrintAddress && I->Size == UnknownAddressOrSize)
447452 continue;
453 if (JustSymbolName) {
454 outs() << I->Name << "\n";
455 continue;
456 }
448457
449458 char SymbolAddrStr[18] = "";
450459 char SymbolSizeStr[18] = "";