[ld] Partially plumb llvm-profdata in startup dynamic linker

This sets up the machinery for the instrumented builds of the
startup dynamic linker to collect their llvm-profdata into a VMO
for publication via the debugdata protocol.  There isn't yet a
way to get that VMO anywhere, so it's just dropped on the floor;
fxbug.dev/130542 tracks actually getting the VMO published.

Unfortunately, this doesn't entirely work as intended because
live function invocations continue to use a stale pointer into
the data segment location of the instrumentation counters.  This
means the tails of functions still running after the counters are
redirected to the debugdata VMO will have their updates lost, so
in future we may need to reorganize the code to avoid that
problem.  For now, the more pressing problem is that writing via
the stale pointer after protecting the data segment will get a
page fault.  So for now protecting the data segment is disabled
in the builds using llvm-profdata instrumentation.

Bug: 130542
Fixed: 130542
Change-Id: I8bfb1dada108ce1f178b7b612e952ab004b66aef
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/886591
Reviewed-by: Petr Hosek <phosek@google.com>
Reviewed-by: Caslyn Tonelli <caslyn@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Fuchsia-Auto-Submit: Roland McGrath <mcgrathr@google.com>
4 files changed
tree: a0ebe572496704722f56c981f1bc1744131fc559
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. infra/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .editorconfig
  17. .git-blame-ignore-revs
  18. .gitattributes
  19. .gitignore
  20. .gitmodules
  21. .gn
  22. .ignore
  23. .style.yapf
  24. analysis_options.yaml
  25. AUTHORS
  26. BUILD.gn
  27. CODE_OF_CONDUCT.md
  28. CONTRIBUTING.md
  29. fuchsia.code-workspace
  30. LICENSE
  31. OWNERS
  32. PATENTS
  33. pyrightconfig.json
  34. README.md
  35. rustfmt.toml
README.md

Fuchsia

What is Fuchsia?

Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.

We expect everyone interacting with our project to respect our code of conduct.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.