[PATCH] D56140: [llvm-readobj] [COFF] Print the symbol index for relocations

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 1 00:04:51 PST 2019


mstorsjo marked an inline comment as done.
mstorsjo added inline comments.


================
Comment at: tools/llvm-readobj/COFFDumper.cpp:1381
     W.printString("Symbol", SymbolName.empty() ? "-" : SymbolName);
+    W.printNumber("SymbolIndex", SymbolIndex);
   } else {
----------------
alexshap wrote:
> one minor concern: if I understand correctly if the symbol is not found (Symbol == Obj->symbol_end()) this code still will print SymbolIndex = 0. Maybe we can do smth similar to how SymbolName is handled ?
Sure, I guess -1 is the only sensible thing to print then. The index can technically be any uint32_t, so storing it in a local int64_t to allow for -1 should be safe then.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56140/new/

https://reviews.llvm.org/D56140





More information about the llvm-commits mailing list