[lld] r354607 - ELF: Remove dead code. NFCI.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 21 10:53:59 PST 2019


Author: pcc
Date: Thu Feb 21 10:53:58 2019
New Revision: 354607

URL: http://llvm.org/viewvc/llvm-project?rev=354607&view=rev
Log:
ELF: Remove dead code. NFCI.

RelocationBaseSection is not used in -r links, so Config->Relocatable will
always be false.

Differential Revision: https://reviews.llvm.org/D58489

Modified:
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=354607&r1=354606&r2=354607&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Thu Feb 21 10:53:58 2019
@@ -1514,9 +1514,8 @@ void RelocationBaseSection::finalizeCont
   // When linking glibc statically, .rel{,a}.plt contains R_*_IRELATIVE
   // relocations due to IFUNC (e.g. strcpy). sh_link will be set to 0 in that
   // case.
-  InputSection *SymTab = Config->Relocatable ? In.SymTab : In.DynSymTab;
-  if (SymTab && SymTab->getParent())
-    getParent()->Link = SymTab->getParent()->SectionIndex;
+  if (In.DynSymTab && In.DynSymTab->getParent())
+    getParent()->Link = In.DynSymTab->getParent()->SectionIndex;
   else
     getParent()->Link = 0;
 




More information about the llvm-commits mailing list