[lld] r275666 - Set sh_addralign in the constructor for consistency. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 19:36:00 PDT 2016


Author: ruiu
Date: Fri Jul 15 21:36:00 2016
New Revision: 275666

URL: http://llvm.org/viewvc/llvm-project?rev=275666&view=rev
Log:
Set sh_addralign in the constructor for consistency. NFC.

Modified:
    lld/trunk/ELF/OutputSections.cpp

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=275666&r1=275665&r2=275666&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Fri Jul 15 21:36:00 2016
@@ -1474,7 +1474,9 @@ SymbolTableSection<ELFT>::getOutputSecti
 
 template <class ELFT>
 VersionDefinitionSection<ELFT>::VersionDefinitionSection()
-    : OutputSectionBase<ELFT>(".gnu.version_d", SHT_GNU_verdef, SHF_ALLOC) {}
+    : OutputSectionBase<ELFT>(".gnu.version_d", SHT_GNU_verdef, SHF_ALLOC) {
+  this->Header.sh_addralign = sizeof(uint32_t);
+}
 
 static StringRef getFileDefName() {
   if (!Config->SoName.empty())
@@ -1490,7 +1492,6 @@ template <class ELFT> void VersionDefini
   this->Header.sh_size =
       (sizeof(Elf_Verdef) + sizeof(Elf_Verdaux)) * getVerDefNum();
   this->Header.sh_link = Out<ELFT>::DynStrTab->SectionIndex;
-  this->Header.sh_addralign = sizeof(uint32_t);
 
   // sh_info should be set to the number of definitions. This fact is missed in
   // documentation, but confirmed by binutils community:




More information about the llvm-commits mailing list