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

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 10 12:34:28 PST 2019


bd1976llvm added a comment.

In D56516#1352925 <https://reviews.llvm.org/D56516#1352925>, @morehouse wrote:

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


Weak-vs-strong count *if* program behaviour is affected by weak vs strong symbol resolution semantics (and I guess that it is in your case otherwise COMDAT selection wouldn't be causing you problems). This is because the ELF standard provides no guarantees as to which COMDAT instance from each duplicate group will be selected (i.e in ELF the selection kind behaviour is always "Any").

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

In ELF (and WebAssembly, apparently, according to the LLVM language reference at least) the only valid selection kind is "Any". My understanding is that this is not the case for COFF where COMDAT processing is more involved. I am not an expert on COFF; but, I don't think that you would need to take weak symbols out of COMDATs for the COFF case to work (In fact I was told that COFF doesn't have weak symbols in the ELF sense).


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

https://reviews.llvm.org/D56516





More information about the llvm-commits mailing list