[PATCH] D71981: [LLD] [COFF] Don't error out on duplicate absolute symbols with the same value

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 21:57:25 PST 2020


mstorsjo marked an inline comment as done.
mstorsjo added inline comments.


================
Comment at: lld/COFF/SymbolTable.cpp:597
+      reportDuplicate(s, nullptr);
+  } else if (!isa<DefinedCOFF>(s))
     reportDuplicate(s, nullptr);
----------------
rnk wrote:
> This looks like the code that makes LLD not report duplicates between absolute and regular symbols. Should we re-evaluate that decision?
> 
> The logic dates back to 79a5e6b1b77efe7770503ebce2a808f0b89d9e50, which doesn't explicitly mention this case. That makes me think this behavior is not intentional, and we can change it.
Yes, we could change it, but I'd treat it as a different change from this one.

As things stand right now, leaving D71711 should work fine, but if we make absolute+regular an error, we'd break the case with multiple objects referencing the same weak, if one object provides a default function which isn't absolute zero.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71981





More information about the llvm-commits mailing list