Summary
Using memory-mapped profile counters makes it possible to take snapshots of a running process's profiling information without changing the program. This is useful if the process exits abnormally, or if profiling data needs to be collected periodically.
Add the clang support required to create instrumented programs which memory-map their counters directly onto a raw profile.
More details
This patch teaches clang to page-align the __llvm_prf_counts section (just on Darwin, initially). Because clang only knows the host system's page size -- not the target system's -- this is a best-effort attempt. If the instrumented program detects that the counters section has the wrong alignment, it will disable the memory-mapped counters feature.
I can add support for other platforms and linkers in follow-up patches.
Depends on: http://reviews.llvm.org/D19293 (llvm)