MachO's sections need a segment as well as a section name, and the section start and end symbols are spelled differently than on ELF.
Details
Diff Detail
Event Timeline
lib/Transforms/Instrumentation/SanitizerCoverage.cpp | ||
---|---|---|
141 | no macros please. |
Agree with @kcc, I don't think we need the prefix abstraction macro and we can just have strings with the full section/symbol name. E.g. in AddressSanitizer.cpp we have:
StringRef AddressSanitizerModule::getGlobalMetadataSection() const { switch (TargetTriple.getObjectFormat()) { case Triple::COFF: return ".ASAN$GL"; case Triple::ELF: return "asan_globals"; case Triple::MachO: return "__DATA,__asan_globals,regular"; default: break; } llvm_unreachable("unsupported object format"); }
Get rid of the pointless string-abstraction macro. As Kostya and Kuba pointed out, it isn't really doing anything (and it's actually longer than just writing out the string).
Also note we'll need to un-xfail a test in compiler-rt when this is committed:
diff --git a/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc b/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
index 1b787f143..e54993c5a 100644
- a/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
+++ b/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cc
@@ -1,7 +1,7 @@
Tests trace pc guard coverage collection.
REQUIRES: has_sancovcc,stable-runtime
- XFAIL: tsan,darwin,powerpc64,s390x
+ XFAIL: tsan,powerpc64,s390x
RUN: DIR=%t_workdir
RUN: rm -rf $DIR
no macros please.