aboutsummaryrefslogtreecommitdiff
path: root/lld/ELF/SyntheticSections.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2021-12-24 12:09:48 -0800
committerFangrui Song <i@maskray.me>2021-12-24 12:09:48 -0800
commite1b6b5be462ee2f197737162fc2a7d23e9a2eab6 (patch)
tree684bf8c0f2a6cf25a2c1ed1426d814079c012a90 /lld/ELF/SyntheticSections.cpp
parent8ea64d5585ec3a0a52db20c9e57ac9bed9e80fc2 (diff)
downloadllvm-e1b6b5be462ee2f197737162fc2a7d23e9a2eab6.zip
llvm-e1b6b5be462ee2f197737162fc2a7d23e9a2eab6.tar.gz
llvm-e1b6b5be462ee2f197737162fc2a7d23e9a2eab6.tar.bz2
[ELF] Avoid referencing SectionBase::repl after ICF
It is fairly easy to forget SectionBase::repl after ICF. Let ICF rewrite a Defined symbol's `section` field to avoid references to SectionBase::repl in subsequent passes. This slightly improves the --icf=none performance due to less indirection (maybe for --icf={safe,all} as well if most symbols are Defined). With this change, there is only one reference to `repl` (--gdb-index D89751). We can undo f4fb5fd7523f8e3c3b3966d43c0a28457b59d1d8 (`Move Repl to SectionBase.`) but move `repl` to `InputSection` instead. Reviewed By: ikudrin Differential Revision: https://reviews.llvm.org/D116093
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r--lld/ELF/SyntheticSections.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index 872dd0e..e480118 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -391,7 +391,7 @@ Defined *EhFrameSection::isFdeLive(EhSectionPiece &fde, ArrayRef<RelTy> rels) {
// FDEs for garbage-collected or merged-by-ICF sections, or sections in
// another partition, are dead.
if (auto *d = dyn_cast<Defined>(&b))
- if (d->section && d->section->partition == partition)
+ if (!d->folded && d->section && d->section->partition == partition)
return d;
return nullptr;
}