Index: lib/Transforms/Instrumentation/InstrProfiling.cpp =================================================================== --- lib/Transforms/Instrumentation/InstrProfiling.cpp +++ lib/Transforms/Instrumentation/InstrProfiling.cpp @@ -233,6 +233,9 @@ } static inline bool shouldRecordFunctionAddr(Function *F) { + // Prohibit the recording the function address if it's internal and COMDAT. + if (F->hasLocalLinkage() && F->hasComdat()) + return false; // Check the linkage if (!F->hasLinkOnceLinkage() && !F->hasLocalLinkage() && !F->hasAvailableExternallyLinkage())