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

Adam Folwarczny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 14:32:07 PDT 2017


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





More information about the llvm-commits mailing list