[LLD][ELF] - Remove the excessive safety return. NFC.
authorGeorge Rimar <grimar@accesssoftek.com>
Mon, 26 Nov 2018 10:33:29 +0000 (10:33 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Mon, 26 Nov 2018 10:33:29 +0000 (10:33 +0000)
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.

llvm-svn: 347543

lld/ELF/SyntheticSections.cpp

index ab71e1b..bf62dcd 100644 (file)
@@ -1257,9 +1257,6 @@ void DynamicSection<ELFT>::addSym(int32_t Tag, Symbol *Sym) {
 
 // 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;