[PATCH] D32688: [Coverage] Comdat section name should be same as the variable name in COFF format

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 14:40:02 PDT 2017


I am fine with a COFF specific change (either linkage or naming) assuming
tests are fine.  Other platforms should be left unchanged.

David

On Wed, May 3, 2017 at 2:32 PM, Adam Folwarczny via Phabricator <
reviews at reviews.llvm.org> wrote:

> adamf added a comment.
>
> > 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.
>
> I have made few tests and changing to InternalLinkage seems also to work.
> The patch is in attachment. F3280107: InstrProfiling.patch <
> https://reviews.llvm.org/F3280107>.
> This patch affects all formats, not only COFF.
> With InternalLinkage we should change both _ _profd and _ _profc. (If we
> change only _ _ profd then counters in the coverage report are not properly
> interpreted).
> Another advantage of using InternalLinkage is that we can check the
> counters for each translation unit.
>
> 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.
>
>
> https://reviews.llvm.org/D32688
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170503/24d35ac1/attachment.html>


More information about the llvm-commits mailing list