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

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 15 14:41:18 PST 2019


smeenai added a comment.

In D56516#1358281 <https://reviews.llvm.org/D56516#1358281>, @rnk wrote:

> In D56516#1353365 <https://reviews.llvm.org/D56516#1353365>, @morehouse wrote:
>
> > In D56516#1353359 <https://reviews.llvm.org/D56516#1353359>, @bd1976llvm wrote:
> >
> > > Hopefully, someone who is an expert on the other file formats might comment (Reid?).
> >
> >
> > @rnk:  How do weak/strong symbols in COMDATs interact on COFF?
>
>
> Well, GCC has some extensions for implementing weak symbols in COFF. I forget if we implement them. Maybe @smeenai remembers, I think Facebook wanted weak symbols for mingw. The Visual C++ linker doesn't implement weak symbols. I think this change will be fine with my suggestion to keep applying comdats when the function is weak_odr. We should also test all the relevant linkages, like plain `linkonce` and `weak_odr`.


COFF has weak externals, and I think gcc emulates weak symbols on top of weak external semantics. LLVM does too, if you use the `weak` + `alias` or `weakref` attributes. I'm not sure how weak externals interact with COMDATs. Note that there are multiple semantics for weak externals themselves, and LLVM/LLD might not be implementing all of them correctly ... https://developercommunity.visualstudio.com/content/problem/384278/link-not-handling-coff-weak-externals.html is a behavior difference between link and LLD, for example.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D56516





More information about the llvm-commits mailing list