[lld] r347543 - [LLD][ELF] - Remove the excessive safety return. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 26 02:33:29 PST 2018


Author: grimar
Date: Mon Nov 26 02:33:29 2018
New Revision: 347543

URL: http://llvm.org/viewvc/llvm-project?rev=347543&view=rev
Log:
[LLD][ELF] - Remove the excessive safety return. NFC.

We explicitly call finalizeContents() only once for
DynamicSection. The code testing we do not do it twice is
just excessive.

It could be an assert, but we don't do
that for other sections, so does not seem we
should do it here too.

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=347543&r1=347542&r2=347543&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Mon Nov 26 02:33:29 2018
@@ -1257,9 +1257,6 @@ void DynamicSection<ELFT>::addSym(int32_
 
 // Add remaining entries to complete .dynamic contents.
 template <class ELFT> void DynamicSection<ELFT>::finalizeContents() {
-  if (this->Size)
-    return; // Already finalized.
-
   // Set DT_FLAGS and DT_FLAGS_1.
   uint32_t DtFlags = 0;
   uint32_t DtFlags1 = 0;




More information about the llvm-commits mailing list