diff options
author | Petr Hosek <phosek@google.com> | 2021-02-19 21:41:45 -0800 |
---|---|---|
committer | Petr Hosek <phosek@google.com> | 2021-02-20 14:20:33 -0800 |
commit | 6b286d93f7ec8518c685a302269e44b06a0a24f3 (patch) | |
tree | 834d18cc534c8f8dd6db9cdef88a867d926777b3 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 77056fe58e83100b902216d7bc6274129f80abda (diff) | |
download | llvm-6b286d93f7ec8518c685a302269e44b06a0a24f3.zip llvm-6b286d93f7ec8518c685a302269e44b06a0a24f3.tar.gz llvm-6b286d93f7ec8518c685a302269e44b06a0a24f3.tar.bz2 |
[InstrProfiling] Use nobits as __llvm_prf_cnts section type in ELF
This can reduce the binary size because counters will no longer occupy
space in the binary, instead they will be allocated by dynamic linker.
Differential Revision: https://reviews.llvm.org/D97110
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 2530fdc..c1383ba 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -440,6 +440,10 @@ static SectionKind getELFKindForNamedSection(StringRef Name, SectionKind K) { Name == ".llvmbc" || Name == ".llvmcmd") return SectionKind::getMetadata(); + if (Name == getInstrProfSectionName(IPSK_cnts, Triple::ELF, + /*AddSegmentInfo=*/false)) + return SectionKind::getBSS(); + if (Name.empty() || Name[0] != '.') return K; // Default implementation based on some magic section names. |