The per function data and counter variables for available externally functions are created with linkonce linkage (to prevent compiler from dropping counter vars). However on ELF based systems, linkonce symbols are created as weak symbols and the duplicated entries are not removed by the linker. For bad consequences it causes, see comments in the code. One example, the profile counts for _ZNKSs7_M_dataEv method is duplicated 655 times in raw profile data of clang. In the merged indexed profile, the counter values are magnified 655x -- totally dwarfed other functions -- this also distorted profile summary a lot leading to not useful profile data.
Details
Details
Diff Detail
Diff Detail