[PATCH] D26417: Use debug info to print out the first line of symbol conflict message.

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 01:57:02 PST 2016


evgeny777 added inline comments.


================
Comment at: ELF/SymbolTable.cpp:391
+                                  typename ELFT::uint ErrOffset) {
+  print(getLocation(*ErrSec, ErrOffset) + ": duplicate symbol '" +
+        maybeDemangle(Existing->getName()) + "'");
----------------
ErrSec may be nullptr, if we're adding absolute symbol


================
Comment at: ELF/SymbolTable.cpp:394
 
-  print(NewLoc + ": duplicate symbol '" + maybeDemangle(Existing->getName()) +
-        "'");
-  print(OldLoc + ": previous definition was here");
+  if (auto *D = dyn_cast<DefinedRegular<ELFT>>(Existing))
+    if (D->Section)
----------------
If Existing is not DefinedRegular but isn't nullptr either, we may still try to use Existing->File to report previously seen location. This isn't covered by initial patch, I think, but would be nice to have.


https://reviews.llvm.org/D26417





More information about the llvm-commits mailing list