Index: lib/Transforms/Instrumentation/InstrProfiling.cpp =================================================================== --- lib/Transforms/Instrumentation/InstrProfiling.cpp +++ lib/Transforms/Instrumentation/InstrProfiling.cpp @@ -257,6 +257,9 @@ if (Triple(M->getTargetTriple()).isOSDarwin()) return; + // Use linker script magic to get data/cnts/name start/end. + if (Triple(M->getTargetTriple()).isOSLinux()) return; + // Construct the function. auto *VoidTy = Type::getVoidTy(M->getContext()); auto *VoidPtrTy = Type::getInt8PtrTy(M->getContext()); Index: test/Instrumentation/InstrProfiling/platform.ll =================================================================== --- test/Instrumentation/InstrProfiling/platform.ll +++ test/Instrumentation/InstrProfiling/platform.ll @@ -23,7 +23,7 @@ ;; symbols by their sections. ; MACHO-NOT: define internal void @__llvm_profile_register_functions -; ELF: define internal void @__llvm_profile_register_functions +; ELF-NOT: define internal void @__llvm_profile_register_functions ; MACHO-NOT: define internal void @__llvm_profile_init -; ELF: define internal void @__llvm_profile_init +; ELF-NOT: define internal void @__llvm_profile_init