[lld] bc89663 - [ELF] MarkLive: remove dead code from D24750. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 5 00:01:18 PDT 2022


Author: Fangrui Song
Date: 2022-09-05T00:01:09-07:00
New Revision: bc89663b69980d8f0c0f02a0068db8ed657376ce

URL: https://github.com/llvm/llvm-project/commit/bc89663b69980d8f0c0f02a0068db8ed657376ce
DIFF: https://github.com/llvm/llvm-project/commit/bc89663b69980d8f0c0f02a0068db8ed657376ce.diff

LOG: [ELF] MarkLive: remove dead code from D24750. NFC

Added: 
    

Modified: 
    lld/ELF/MarkLive.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp
index 87946edb3c09..d042f33dc2b6 100644
--- a/lld/ELF/MarkLive.cpp
+++ b/lld/ELF/MarkLive.cpp
@@ -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.


        


More information about the llvm-commits mailing list