<div dir="ltr">I am fine with a COFF specific change (either linkage or naming) assuming tests are fine.  Other platforms should be left unchanged.<div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 3, 2017 at 2:32 PM, Adam Folwarczny via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">adamf added a comment.<br>
<span class=""><br>
> I suspect that the appropriate fix is to give the __profd variables internal linkage, not to change the comdat name. The linker will still discard duplicate profc and profd sections with this change.<br>
<br>
</span>I have made few tests and changing to InternalLinkage seems also to work. The patch is in attachment. F3280107: InstrProfiling.patch <<a href="https://reviews.llvm.org/F3280107" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>F3280107</a>>.<br>
This patch affects all formats, not only COFF.<br>
With InternalLinkage we should change both _ _profd and _ _profc. (If we change only _ _ profd then counters in the coverage report are not properly interpreted).<br>
Another advantage of using InternalLinkage is that we can check the counters for each translation unit.<br>
<br>
Because fixing this problem starts to affect more amount of code and requires wider knowledge I am afraid that I won't be able to provide fully valuable fix.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D32688" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D32688</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>