[PATCH] D28434: [Sanitizer Coverage] Fix Instrumentation to work on Windows.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 15:30:37 PST 2017


mpividori added inline comments.


================
Comment at: lib/Transforms/Instrumentation/SanitizerCoverage.cpp:372-387
+      GlobalVariable *SectionStart, *SectionStop;
+      SectionStart = new GlobalVariable(M, Int32PtrTy, false,
+          GlobalVariable::ExternalLinkage, nullptr,
+          SanCovTracePCGuardSectionStart);
+      SectionStart->setVisibility(GlobalValue::HiddenVisibility);
+      SectionStop = new GlobalVariable(M, Int32PtrTy, false,
+          GlobalVariable::ExternalLinkage, nullptr,
----------------
mpividori wrote:
> rnk wrote:
> > I don't think we need this dynamic initialization in every TU on Windows. If ___start___sancov_guard is linked statically into every DLL, we can add code to that object file to call __sanitizer_cov_trace_pc_guard_init on Windows.
> @rnk, do you mean register this function in the section ".CRT$XCU" , like you do with `register_dso_globals`? Yes, I agree.
> Here, I just updated the code to do the same than on linux. I think we can improve this as you suggest, also for linux.
@rnk I think this approach is ok for now, so we do the same than for linux, and we simplify the code.


Repository:
  rL LLVM

https://reviews.llvm.org/D28434





More information about the llvm-commits mailing list