[lld] [lld][elf] Skip BP ordering input sections with null data (PR #149265)
Pengying Xu via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 17 09:24:13 PDT 2025
================
@@ -76,10 +76,10 @@ DenseMap<const InputSectionBase *, int> elf::runBalancedPartitioning(
if (!d)
return;
auto *sec = dyn_cast_or_null<InputSection>(d->section);
- // Skip empty, discarded, ICF folded sections. Skipping ICF folded sections
- // reduces duplicate detection work in BPSectionOrderer.
+ // Skip empty, discarded, ICF folded sections, .bss. Skipping ICF folded
+ // sections reduces duplicate detection work in BPSectionOrderer.
if (!sec || sec->size == 0 || !sec->isLive() || sec->repl != sec ||
- !orderer.secToSym.try_emplace(sec, d).second)
+ !orderer.secToSym.try_emplace(sec, d).second || !sec->content().data())
----------------
Colibrow wrote:
Yeah. Fixed it.
https://github.com/llvm/llvm-project/pull/149265
More information about the llvm-commits
mailing list