Index: lib/Transforms/Instrumentation/SanitizerCoverage.cpp =================================================================== --- lib/Transforms/Instrumentation/SanitizerCoverage.cpp +++ lib/Transforms/Instrumentation/SanitizerCoverage.cpp @@ -636,11 +636,15 @@ AllBlocks.size(), F, Int32Ty, SanCovGuardsSectionName); GlobalsToAppendToUsed.push_back(FunctionGuardArray); } - if (Options.Inline8bitCounters) + if (Options.Inline8bitCounters) { Function8bitCounterArray = CreateFunctionLocalArrayInSection( AllBlocks.size(), F, Int8Ty, SanCovCountersSectionName); - if (Options.PCTable) + GlobalsToAppendToUsed.push_back(Function8bitCounterArray); + } + if (Options.PCTable) { FunctionPCsArray = CreatePCArray(F, AllBlocks); + GlobalsToAppendToUsed.push_back(FunctionPCsArray); + } } bool SanitizerCoverageModule::InjectCoverage(Function &F,