[ELF] MarkLive: remove dead code from D24750. NFC
authorFangrui Song <i@maskray.me>
Mon, 5 Sep 2022 07:01:09 +0000 (00:01 -0700)
committerFangrui Song <i@maskray.me>
Mon, 5 Sep 2022 07:01:09 +0000 (00:01 -0700)
lld/ELF/MarkLive.cpp

index 87946ed..d042f33 100644 (file)
@@ -181,13 +181,6 @@ static bool isReserved(InputSectionBase *sec) {
 
 template <class ELFT>
 void MarkLive<ELFT>::enqueue(InputSectionBase *sec, uint64_t offset) {
-  // Skip over discarded sections. This in theory shouldn't happen, because
-  // the ELF spec doesn't allow a relocation to point to a deduplicated
-  // COMDAT section directly. Unfortunately this happens in practice (e.g.
-  // .eh_frame) so we need to add a check.
-  if (sec == &InputSection::discarded)
-    return;
-
   // Usually, a whole section is marked as live or dead, but in mergeable
   // (splittable) sections, each piece of data has independent liveness bit.
   // So we explicitly tell it which offset is in use.