The 'undefined symbol' is likely most common linker error, so linker typically show some location information
to make identifying problem source easier. With this patch lld will show following information about error source:
- Source file name in case STT_FILE symbol is present in object file
- Function name, if it can be retrieved.
- section name + offset
In addition to this ld/gold can show line number if debug info is present. This is the next thing I plan to do.
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.