This fixes the second part of PR42407.
The message is designed to match what the ELF linker prints, and the message for undefined references.
One part of the message is the name of the symbol where the duplicate occured, which is redundant, as that's printed as the original root issue anyway (but the ELF linker does it similarly).
For files with dwarf debug info, it manually loads and iterates .debug_info to find the declared location of variables, to allow reporting them. (This matches the corresponding code in the ELF linker. This code perhaps even could be shared somewhere in lld/Common?)
For functions, it uses the existing getFileLineDwarf which uses LLVMSymbolizer for translating addresses to file lines.
In object files with codeview debug info, only the source location of duplicate functions is printed. (And even there, only for the first input file. The getFileLineCodeView function requires the object file to be fully loaded and initialized to properly resolve source locations, but duplicate symbols are reported at a stage when the second object file isn't fully loaded yet.)
Please add a comment saying that this is using DWARF debug info instead of PDB, which is not very common.