[llvm] r204024 - llvm-readobj: Print referred symbol name for CLR token definition
Nico Rieck
nico.rieck at gmail.com
Sun Mar 16 18:46:52 PDT 2014
Author: nrieck
Date: Sun Mar 16 20:46:52 2014
New Revision: 204024
URL: http://llvm.org/viewvc/llvm-project?rev=204024&view=rev
Log:
llvm-readobj: Print referred symbol name for CLR token definition
Modified:
llvm/trunk/test/tools/llvm-readobj/cxx-cli-aux.test
llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
Modified: llvm/trunk/test/tools/llvm-readobj/cxx-cli-aux.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/cxx-cli-aux.test?rev=204024&r1=204023&r2=204024&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/cxx-cli-aux.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/cxx-cli-aux.test Sun Mar 16 20:46:52 2014
@@ -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: }
Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=204024&r1=204023&r2=204024&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Sun Mar 16 20:46:52 2014
@@ -1058,10 +1058,19 @@ void COFFDumper::printSymbol(symbol_iter
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 {
More information about the llvm-commits
mailing list