[PATCH] D25826: [ELF] Show error location for 'undefined symbol' errors

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 12:56:20 PDT 2016

ruiu added inline comments.

Comment at: ELF/Error.cpp:42
+void elf::error(const Twine &Source, const Twine &Msg) {
+  *ErrorOS << Source << ": error: " << Msg << "\n";
   HasError = true;
evgeny777 wrote:
> ruiu wrote:
> > I think I'm inclined to showing ARGV[0] even for undefined symbol errors to keep them consistent with other linker-issued errors. I do not see a reason to not do except for making error lines a bit shorter.
> No problem, but you'll get both path to linker and path to file in a single error message. Isn't this confusing? BTW ld and gold don't show argv0 for this error type.
Clang doesn't seem to print out a full path but instead of the last path component (so it prints out "clang-4.0" instead of "/foo/bar/clang-4.0"). We might want to do the same. But for now I think we want to handle all errors in the same way. We can tweak later if we want it.


More information about the llvm-commits mailing list