[lld] r343762 - [ELF] - Simplify. NFCI.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 4 02:31:15 PDT 2018


Author: grimar
Date: Thu Oct  4 02:31:15 2018
New Revision: 343762

URL: http://llvm.org/viewvc/llvm-project?rev=343762&view=rev
Log:
[ELF] - Simplify. NFCI.

Assign the `Link` to parent directly.

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=343762&r1=343761&r2=343762&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Thu Oct  4 02:31:15 2018
@@ -1494,10 +1494,8 @@ void RelocationBaseSection::finalizeCont
   // If all relocations are R_*_RELATIVE they don't refer to any
   // dynamic symbol and we don't need a dynamic symbol table. If that
   // is the case, just use 0 as the link.
-  Link = In.DynSymTab ? In.DynSymTab->getParent()->SectionIndex : 0;
-
-  // Set required output section properties.
-  getParent()->Link = Link;
+  getParent()->Link =
+      In.DynSymTab ? In.DynSymTab->getParent()->SectionIndex : 0;
 }
 
 RelrBaseSection::RelrBaseSection()




More information about the llvm-commits mailing list