[PATCH] D68975: [LLD] [COFF] Try to report source locations for duplicate symbols

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 12:54:44 PDT 2019


mstorsjo added a comment.

In D68975#1713475 <https://reviews.llvm.org/D68975#1713475>, @thakis wrote:

> In D68975#1712187 <https://reviews.llvm.org/D68975#1712187>, @ruiu wrote:
>
> > Nico, are you happy with this change?
>
>
> The output looks fine from what's in the test expectations. To know how it feels in practice I think it's best to land this and use it for a bit.


FWIW, I tried mirroring what the corresponding message in the ELF linker looks like, but with less redundancy in the message. (When reporting an undefined reference, locating what symbol the undefined reference is in is a good help even if you don't get a source line - but when reporting a duplicate definition, "finding" the symbol name of each of the conflicting definitions is pointless.)

> Code-wise, it's quite a bit of code for dwarf debug info which isn't really used all that much, but meh. I kind of feel like it might possibly make sense to move all the CoffMingw bits into a separate lld/ directory instead of having it in lld/COFF since it's lots of special purpose code. But that's not my call :)

I think some parts of the verbose dwarf code here could be refactored into lld/Common and share it with the ELF linker, but I'd prefer doing that as a separate step after landing this if that's tolerable (as some refactorings easily end up dragging on longer than initially expected). For other mingw related bits, we do have COFF/MinGW.cpp for logic that is easily decoupled from the rest of the COFF logic.


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

https://reviews.llvm.org/D68975





More information about the llvm-commits mailing list