These were removed in dc93b1127c5e0621e672745d26bce5a11f68d943 (D97648).
In addition to adding them back, mark them as "retained".
This change is needed for allowing continuous-mode profile creation for
Linux (and Android in particular).
- We're relying on 'OVERWRITE_SECTIONS' linker feature to set alignment
of llvm_prf_data and llvm_prf_cnts. If an OVERWRITE_SECTIONS is
present, lld adds the start/stop symbols for these sections even if
the eventual binary doesn't have these sections leading to
llvm-objcopy/llvm-strip complaining about malformed binaries. Adding
these dummy sections ensures that the start/stop symbols point to a
valid, albeit zero-sized section.
- We also need to mark these symbols with attribute "retain" to ensure
these symbols and sections are not removed with --gc-sections.
clang-tidy: warning: unknown attribute 'retain' ignored [clang-diagnostic-unknown-attributes]
not useful