[lld] r268070 - Fix the alignment of the version info.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 29 10:19:45 PDT 2016
Author: rafael
Date: Fri Apr 29 12:19:45 2016
New Revision: 268070
URL: http://llvm.org/viewvc/llvm-project?rev=268070&view=rev
Log:
Fix the alignment of the version info.
Modified:
lld/trunk/ELF/OutputSections.cpp
lld/trunk/test/ELF/verneed.s
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=268070&r1=268069&r2=268070&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Fri Apr 29 12:19:45 2016
@@ -1521,7 +1521,9 @@ SymbolTableSection<ELFT>::getOutputSecti
template <class ELFT>
VersionTableSection<ELFT>::VersionTableSection()
- : OutputSectionBase<ELFT>(".gnu.version", SHT_GNU_versym, SHF_ALLOC) {}
+ : OutputSectionBase<ELFT>(".gnu.version", SHT_GNU_versym, SHF_ALLOC) {
+ this->Header.sh_addralign = sizeof(typename ELFT::Half);
+}
template <class ELFT> void VersionTableSection<ELFT>::finalize() {
this->Header.sh_size =
@@ -1544,7 +1546,9 @@ template <class ELFT> void VersionTableS
template <class ELFT>
VersionNeedSection<ELFT>::VersionNeedSection()
- : OutputSectionBase<ELFT>(".gnu.version_r", SHT_GNU_verneed, SHF_ALLOC) {}
+ : OutputSectionBase<ELFT>(".gnu.version_r", SHT_GNU_verneed, SHF_ALLOC) {
+ this->Header.sh_addralign = sizeof(typename ELFT::Word);
+}
template <class ELFT>
void VersionNeedSection<ELFT>::addSymbol(SharedSymbol<ELFT> *SS) {
Modified: lld/trunk/test/ELF/verneed.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/verneed.s?rev=268070&r1=268069&r2=268070&view=diff
==============================================================================
--- lld/trunk/test/ELF/verneed.s (original)
+++ lld/trunk/test/ELF/verneed.s Fri Apr 29 12:19:45 2016
@@ -15,7 +15,7 @@
# CHECK-NEXT: Size: 8
# CHECK-NEXT: Link: 0
# CHECK-NEXT: Info: 0
-# CHECK-NEXT: AddressAlignment: 0
+# CHECK-NEXT: AddressAlignment: 2
# CHECK-NEXT: EntrySize: 2
# CHECK-NEXT: }
# CHECK-NEXT: Section {
@@ -30,7 +30,7 @@
# CHECK-NEXT: Size: 80
# CHECK-NEXT: Link: 5
# CHECK-NEXT: Info: 2
-# CHECK-NEXT: AddressAlignment: 0
+# CHECK-NEXT: AddressAlignment: 4
# CHECK-NEXT: EntrySize: 0
# CHECK-NEXT: }
More information about the llvm-commits
mailing list