I don't particularly like this approach.
The change in linkage for link once symbols is needed for ELF targets.
Although the symbol is only associated once, the discarded symbols
still occupy memory. This causes duplicate count problem at runtime
because the raw profile contains multiple copies of the same data
record (see https://llvm.org/bugs/show_bug.cgi?id=23499 for details).