ELF: Remove dead code. NFCI.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 21 Feb 2019 18:53:58 +0000 (18:53 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 21 Feb 2019 18:53:58 +0000 (18:53 +0000)
RelocationBaseSection is not used in -r links, so Config->Relocatable will
always be false.

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

llvm-svn: 354607

lld/ELF/SyntheticSections.cpp

index 98894bf..c2817df 100644 (file)
@@ -1514,9 +1514,8 @@ void RelocationBaseSection::finalizeContents() {
   // 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;