[lld] bbf7b9d - [ELF] Remove unused setSymbolAndType after #69295. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 15:08:18 PDT 2023


Author: Fangrui Song
Date: 2023-10-17T15:08:13-07:00
New Revision: bbf7b9d805f5773b4fe5bfb69081fe3691a90fb5

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

LOG: [ELF] Remove unused setSymbolAndType after #69295. NFC

One use of setSymbolAndType (related to https://reviews.llvm.org/D53864
"Do not crash when -r output uses linker script with `/DISCARD/`")
is no longer needed after commit 1981b1b6b92f7579a30c9ed32dbdf3bc749c1b40
demotes symbols in discarded sections to Undefined.

Added: 
    

Modified: 
    lld/ELF/InputSection.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 413fa3856a1426c..02394cbae95d557 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -435,10 +435,7 @@ void InputSection::copyRelocations(uint8_t *buf,
         continue;
       }
       SectionBase *section = d->section;
-      if (!section->isLive()) {
-        p->setSymbolAndType(0, 0, false);
-        continue;
-      }
+      assert(section->isLive());
 
       int64_t addend = rel.addend;
       const uint8_t *bufLoc = sec->content().begin() + rel.offset;


        


More information about the llvm-commits mailing list