[lld] [llvm] [lld][DebugInfo/BTF] Add BTF section merging and deduplication (PR #183915)
Can H. Tartanoglu via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 4 13:19:57 PDT 2026
================
@@ -3676,6 +3678,53 @@ void GdbIndexSection::writeTo(uint8_t *buf) {
bool GdbIndexSection::isNeeded() const { return !chunks.empty(); }
+BtfSection::BtfSection(Ctx &ctx)
+ : SyntheticSection(ctx, ".BTF", SHT_PROGBITS, 0, 1) {}
+
+template <class ELFT>
+std::unique_ptr<BtfSection> BtfSection::create(Ctx &ctx) {
+ llvm::TimeTraceScope timeScope("Merge BTF");
+
+ const bool isLE = ELFT::Endianness == llvm::endianness::little;
----------------
caniko wrote:
The blank line after `TimeTraceScope` is removed. `btf-merge-be.s` assembles and links powerpc64 inputs and checks the big-endian BTF magic.
Source: https://github.com/llvm/llvm-project/blob/3362413f61ac2e1718fd8ecdb9ef46b4dcc452ee/lld/ELF/SyntheticSections.cpp ; https://github.com/llvm/llvm-project/blob/3362413f61ac2e1718fd8ecdb9ef46b4dcc452ee/lld/test/ELF/btf-merge-be.s. These file blobs are identical to tested head `ba019710f5de8180761c40fa1e90dff5f578ecfd`: [premerge checks](https://github.com/llvm/llvm-project/actions/runs/23135916624) and [formatter](https://github.com/llvm/llvm-project/actions/runs/23135916579) passed there. Head `3362413f61ac2e1718fd8ecdb9ef46b4dcc452ee` only strengthens a separate COMDAT assertion; its new test qualification and the end-to-end kernel receipts remain pending.
https://github.com/llvm/llvm-project/pull/183915
More information about the llvm-commits
mailing list