[LLD] [COFF] Fix reporting duplicate errors for absolute symbols
authorMartin Storsjö <martin@martin.st>
Wed, 18 Dec 2019 21:58:51 +0000 (23:58 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 19 Dec 2019 10:14:08 +0000 (12:14 +0200)
commit29d8c27c65289d1ed370861ff75f309a689a22cb
tree69b709f133125019e57cb64f264c2de77a42cd5d
parent200cce345dcf114a1b1012bc9c68adef6c99a595
[LLD] [COFF] Fix reporting duplicate errors for absolute symbols

Previously this caused crashes in the reportDuplicate method.

A DefinedAbsolute doesn't have any InputFile attached to it, so we
can't report the file for the original symbol.

We could add an InputFile argument to SymbolTable::addAbsolute
only for the sake of error reporting, but even then it'd be assymetrical,
only pointing out the file containing the new conflicting definition,
not the original one.

Differential Revision: https://reviews.llvm.org/D71679
lld/COFF/SymbolTable.cpp
lld/test/COFF/duplicate-absolute.s [new file with mode: 0644]