When non-default profile name is specified on command line, the current instrumentation needs to synthesize llvm_profile_init function and emits function call to llvm_profile_override_filename (in addition to creating a char array variable with private linkage to hold the name).
In fact, such calls are completely unnecessary. It is enough to promote the profile name var to global linkage in comdat (or weakany) and eliminate the call. The text size will be reduced, so will the readonly data size (duplicates gets commoned). The runtime start up time will also improve slightly.
What's the advantage of placing the file name var in a comdat if it already has weak linkage? Would some ELF tests break without this?