[PATCH] D56516: [SanitizerCoverage] Don't create comdat for weak functions.

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 10 08:56:31 PST 2019


morehouse added a comment.

In D56516#1352524 <https://reviews.llvm.org/D56516#1352524>, @bd1976llvm wrote:

> I wonder if it is the same problem as here: https://reviews.llvm.org/D53234 which is a case of the global referenced via `!associated` is being dropped.


That looks like it's addressing a different problem.  In the case I'm concerned about, globals are never dropped from the COMDAT.  Rather, a COMDAT containing a weak symbol is chosen over a COMDAT with a strong symbol.

> Having said that there is definitely a bug in compiler here at least for ELF. In ELF given the duplication behavior specified for GRP_COMDAT, each set of duplicate COMDATs has an "api" made up of the globals that are part of the COMDATs in that set and are referenced from anywhere in the program outside of that COMDAT set. Each instance of a COMDAT group must have this "api" in common, otherwise the program might fail to link, or have arbitrarily different run-time behavior (depending on which COMDAT is selected).

Does weak-vs-strong count towards that "api"?  Because that's the only difference in the case I'm seeing...

And does the COMDAT need to have a SelectionKind of `ExactMatch` to enforce the API, or does `Any` suffice?


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

https://reviews.llvm.org/D56516





More information about the llvm-commits mailing list