[ELF] Simplify includeInSymtab. NFC

This commit is contained in:
Fangrui Song 2022-02-05 11:18:08 -08:00
parent bb4eacdb70
commit 38e6361d84
1 changed files with 2 additions and 7 deletions

View File

@ -675,14 +675,9 @@ static bool includeInSymtab(const Symbol &b) {
if (!sec)
return true;
// Exclude symbols pointing to garbage-collected sections.
if (isa<InputSectionBase>(sec) && !sec->isLive())
return false;
if (auto *s = dyn_cast<MergeInputSection>(sec))
if (!s->getSectionPiece(d->value)->live)
return false;
return true;
return s->getSectionPiece(d->value)->live;
return sec->isLive();
}
return b.used || !config->gcSections;
}