Skip to content

Commit

Permalink
llvm-readobj: Print referred symbol name for CLR token definition
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204024 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
gix committed Mar 17, 2014
1 parent 23653b1 commit 717b36b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/tools/llvm-readobj/cxx-cli-aux.test
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CHECK-NEXT: AuxSymbolCount: 1
CHECK-NEXT: AuxCLRToken {
CHECK-NEXT: AuxType: 1
CHECK-NEXT: Reserved: 0
CHECK-NEXT: SymbolTableIndex: 19
CHECK-NEXT: SymbolTableIndex: ?PerAppDomain@@$$Q3HA (19)
CHECK-NEXT: Unused: (00 00 00 00 00 00 00 00 00 00 00 00)
CHECK-NEXT: }
CHECK-NEXT: }
11 changes: 10 additions & 1 deletion tools/llvm-readobj/COFFDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,10 +1058,19 @@ void COFFDumper::printSymbol(symbol_iterator SymI) {
if (error(getSymbolAuxData(Obj, Symbol + I, Aux)))
break;

const coff_symbol *ReferredSym;
StringRef ReferredName;
error_code EC;
if ((EC = Obj->getSymbol(Aux->SymbolTableIndex, ReferredSym)) ||
(EC = Obj->getSymbolName(ReferredSym, ReferredName))) {
ReferredName = "";
error(EC);
}

DictScope AS(W, "AuxCLRToken");
W.printNumber("AuxType", Aux->AuxType);
W.printNumber("Reserved", Aux->Reserved);
W.printNumber("SymbolTableIndex", Aux->SymbolTableIndex);
W.printNumber("SymbolTableIndex", ReferredName, Aux->SymbolTableIndex);
W.printBinary("Unused", Aux->Unused);

} else {
Expand Down

0 comments on commit 717b36b

Please sign in to comment.